Skip to content

Commit 4e84d85

Browse files
committed
Update ApiController.cs
1 parent 3f94430 commit 4e84d85

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

Controllers/ApiController.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public JsonResult JacRedConf(string apikey)
3535

3636
#region Jackett
3737
[Route("/api/v2.0/indexers/{status}/results")]
38-
public ActionResult Jackett(string query, string title, string title_original, int year, int is_serial, Dictionary<string, string> category)
38+
public ActionResult Jackett(string apikey, string query, string title, string title_original, int year, int is_serial, Dictionary<string, string> category)
3939
{
4040
bool rqnum = false, setcache = false;
4141
var torrents = new Dictionary<string, TorrentDetails>();
@@ -496,9 +496,13 @@ List<ffStream> FFprobe(TorrentDetails t, out HashSet<string> langs)
496496
}
497497
#endregion
498498

499+
var result = tsort.OrderByDescending(i => i.createTime).Take(2_000);
500+
if (apikey == "rus")
501+
result = result.Where(i => i.languages != null && i.languages.Contains("rus"));
502+
499503
jval = JsonConvert.SerializeObject(new
500504
{
501-
Results = tsort.OrderByDescending(i => i.createTime).Take(2_000).Select(i => new
505+
Results = result.Select(i => new
502506
{
503507
Tracker = i.trackerName,
504508
Details = i.url != null && i.url.StartsWith("http") ? i.url : null,

0 commit comments

Comments
 (0)