From 9efe27ca7acc2f7e2d08d0972b439f215ff28890 Mon Sep 17 00:00:00 2001 From: Cory Date: Sun, 9 Feb 2020 23:29:39 -0600 Subject: [PATCH] avistaz, privatehd, cinemaz: Remove string sanitising from search query (#7175) resolves #7167 --- .../Indexers/Abstract/AvistazTracker.cs | 28 +++++++++---------- src/Jackett.Common/Indexers/Avistaz.cs | 14 ++-------- 2 files changed, 15 insertions(+), 27 deletions(-) diff --git a/src/Jackett.Common/Indexers/Abstract/AvistazTracker.cs b/src/Jackett.Common/Indexers/Abstract/AvistazTracker.cs index 1d45bf79b..fbd87a4bb 100644 --- a/src/Jackett.Common/Indexers/Abstract/AvistazTracker.cs +++ b/src/Jackett.Common/Indexers/Abstract/AvistazTracker.cs @@ -17,20 +17,17 @@ namespace Jackett.Common.Indexers.Abstract { public abstract class AvistazTracker : BaseWebIndexer { - private string LoginUrl { get { return SiteLink + "auth/login"; } } - private string SearchUrl { get { return SiteLink + "torrents?in=1&type={0}&search={1}"; } } + private string LoginUrl => SiteLink + "auth/login"; + private string SearchUrl => SiteLink + "torrents?in=1&type={0}&search={1}"; - new ConfigurationDataBasicLogin configData + private new ConfigurationDataBasicLogin configData { - get { return (ConfigurationDataBasicLogin)base.configData; } - set { base.configData = value; } + get => (ConfigurationDataBasicLogin)base.configData; + set => base.configData = value; } // hook to adjust the search term - protected virtual string GetSearchTerm(TorznabQuery query) - { - return query.GetQueryString(); - } + protected string GetSearchTerm(TorznabQuery query) => $"{query.SearchTerm} {query.GetEpisodeSearchString()}"; public AvistazTracker(IIndexerConfigurationService configService, Utils.Clients.WebClient webClient, Logger logger, IProtectionService protectionService, string name, string desc, string link) : base(name: name, @@ -83,7 +80,7 @@ namespace Jackett.Common.Indexers.Abstract var releases = new List(); var categoryMapping = MapTorznabCapsToTrackers(query).Distinct(); - string category = "0"; // Aka all + var category = "0"; // Aka all if (categoryMapping.Count() == 1) { category = categoryMapping.First(); @@ -106,11 +103,12 @@ namespace Jackett.Common.Indexers.Abstract var rows = dom["table:has(thead) > tbody > tr"]; foreach (var row in rows) { - CQ qRow = row.Cq(); - var release = new ReleaseInfo(); - - release.MinimumRatio = 1; - release.MinimumSeedTime = 172800; // 48 hours + var qRow = row.Cq(); + var release = new ReleaseInfo + { + MinimumRatio = 1, + MinimumSeedTime = 172800 // 48 hours + }; var qLink = qRow.Find("a.torrent-filename"); ; diff --git a/src/Jackett.Common/Indexers/Avistaz.cs b/src/Jackett.Common/Indexers/Avistaz.cs index 889740fb5..43ac5d19d 100644 --- a/src/Jackett.Common/Indexers/Avistaz.cs +++ b/src/Jackett.Common/Indexers/Avistaz.cs @@ -1,5 +1,4 @@ using Jackett.Common.Indexers.Abstract; -using Jackett.Common.Models; using Jackett.Common.Services.Interfaces; using Jackett.Common.Utils.Clients; using NLog; @@ -15,16 +14,7 @@ namespace Jackett.Common.Indexers configService: configService, logger: logger, protectionService: protectionService, - webClient: webClient - ) - { - Type = "private"; - } - - // hook to adjust the search term - protected override string GetSearchTerm(TorznabQuery query) - { - return query.SanitizedSearchTerm; - } + webClient: webClient) + => Type = "private"; } }