diff --git a/src/Jackett.Common/Indexers/Abstract/GazelleTracker.cs b/src/Jackett.Common/Indexers/Abstract/GazelleTracker.cs index 845935125..03daceebf 100644 --- a/src/Jackett.Common/Indexers/Abstract/GazelleTracker.cs +++ b/src/Jackett.Common/Indexers/Abstract/GazelleTracker.cs @@ -23,6 +23,7 @@ namespace Jackett.Common.Indexers.Abstract protected string DownloadUrl { get { return SiteLink + "torrents.php?action=download&usetoken=" + (useTokens ? "1" : "0") + "&id="; } } protected string DetailsUrl { get { return SiteLink + "torrents.php?torrentid="; } } protected bool supportsFreeleechTokens; + protected bool imdbInTags; protected bool supportsCategories = true; // set to false if the tracker doesn't include the categories in the API search results protected bool useTokens = false; @@ -32,7 +33,7 @@ namespace Jackett.Common.Indexers.Abstract set { base.configData = value; } } - public GazelleTracker(IIndexerConfigurationService configService, Utils.Clients.WebClient webClient, Logger logger, IProtectionService protectionService, string name, string desc, string link, bool supportsFreeleechTokens) + public GazelleTracker(IIndexerConfigurationService configService, Utils.Clients.WebClient webClient, Logger logger, IProtectionService protectionService, string name, string desc, string link, bool supportsFreeleechTokens, bool imdbInTags = false) : base(name: name, description: desc, link: link, @@ -45,6 +46,7 @@ namespace Jackett.Common.Indexers.Abstract { Encoding = Encoding.UTF8; this.supportsFreeleechTokens = supportsFreeleechTokens; + this.imdbInTags = imdbInTags; if (supportsFreeleechTokens) { @@ -112,7 +114,10 @@ namespace Jackett.Common.Indexers.Abstract if (!string.IsNullOrWhiteSpace(query.ImdbID)) { - queryCollection.Add("cataloguenumber", query.ImdbID); + if (this.imdbInTags) + queryCollection.Add("taglist", query.ImdbID); + else + queryCollection.Add("cataloguenumber", query.ImdbID); } else if (!string.IsNullOrWhiteSpace(searchString)) { @@ -183,6 +188,26 @@ namespace Jackett.Common.Indexers.Abstract if (tags != null && tags.Count > 0 && (string)tags[0] != "") release.Description += "Tags: " + string.Join(", ", tags) + "\n"; + if (imdbInTags) + { + int? currentTagImdbId; + // Check if multiple IMDb IDs exist + // If they do, show no IMDb link + foreach (var tag in tags) + { + currentTagImdbId = ParseUtil.GetImdbID((string)tag); + if (currentTagImdbId != null && release.Imdb == null) + { + release.Imdb = currentTagImdbId; + } + else if (currentTagImdbId != null) + { + release.Imdb = null; + break; + } + } + } + if (r["torrents"] is JArray) { foreach (JObject torrent in r["torrents"]) diff --git a/src/Jackett.Common/Indexers/AlphaRatio.cs b/src/Jackett.Common/Indexers/AlphaRatio.cs index 64069ac1b..c6467a48b 100644 --- a/src/Jackett.Common/Indexers/AlphaRatio.cs +++ b/src/Jackett.Common/Indexers/AlphaRatio.cs @@ -8,7 +8,7 @@ namespace Jackett.Common.Indexers { public class AlphaRatio : GazelleTracker { - public AlphaRatio(IIndexerConfigurationService configService, WebClient webClient, Logger logger, IProtectionService protectionService) + public AlphaRatio(IIndexerConfigurationService configService, Utils.Clients.WebClient webClient, Logger logger, IProtectionService protectionService) : base(name: "AlphaRatio", desc: "AlphaRatio (AR) is a Private Torrent Tracker for 0DAY / GENERAL", link: "https://alpharatio.cc/", @@ -16,11 +16,13 @@ namespace Jackett.Common.Indexers logger: logger, protectionService: protectionService, webClient: webClient, - supportsFreeleechTokens: true + supportsFreeleechTokens: true, + imdbInTags: true ) { Language = "en-us"; Type = "private"; + TorznabCaps.SupportsImdbMovieSearch = true; AddCategoryMapping(1, TorznabCatType.TVSD, "TvSD"); AddCategoryMapping(2, TorznabCatType.TVHD, "TvHD");