From e92bef31ef4830cf9a7acf5852525a060593b3ea Mon Sep 17 00:00:00 2001 From: Diego Heras Date: Mon, 30 Mar 2020 03:25:21 +0200 Subject: [PATCH] pretome: add configuration instructions (#7925) --- src/Jackett.Common/Indexers/Pretome.cs | 18 +++++++++--------- .../ConfigurationDataPinNumber.cs | 4 +++- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/src/Jackett.Common/Indexers/Pretome.cs b/src/Jackett.Common/Indexers/Pretome.cs index 31723eebe..927f40cfd 100644 --- a/src/Jackett.Common/Indexers/Pretome.cs +++ b/src/Jackett.Common/Indexers/Pretome.cs @@ -30,7 +30,7 @@ namespace Jackett.Common.Indexers configService: configService, logger: l, p: ps, - configData: new ConfigurationDataPinNumber()) + configData: new ConfigurationDataPinNumber("For best results, change the 'Torrents per page' setting to 100 in 'Profile => Torrent browse settings'.")) { Encoding = Encoding.GetEncoding("iso-8859-1"); Language = "en-us"; @@ -140,7 +140,7 @@ namespace Jackett.Common.Indexers await FollowIfRedirect(result, LoginUrl, null, loginCookies); await ConfigureIfOK(loginCookies, result.Content?.Contains("logout.php") == true, - () => throw new ExceptionWithConfigData("Failed", configData)); + () => throw new ExceptionWithConfigData("Login failed", configData)); return IndexerConfigurationStatus.RequiresTesting; } @@ -149,18 +149,18 @@ namespace Jackett.Common.Indexers { var releases = new List(); - var qc = new List>(); // NameValueCollection don't support cat[]=19&cat[]=6 + var qc = new List> // NameValueCollection don't support cat[]=19&cat[]=6 + { + {"st", "1"} // search in title + }; + if (query.IsImdbQuery) { qc.Add("search", query.ImdbID); - qc.Add("st", "1"); - qc.Add("sd", "1"); + qc.Add("sd", "1"); // search in description } - else if (!string.IsNullOrWhiteSpace(query.GetQueryString())) - { + else qc.Add("search", query.GetQueryString()); - qc.Add("st", "1"); - } // parse categories and tags var catGroups = new HashSet(); // HashSet instead of List to avoid duplicates diff --git a/src/Jackett.Common/Models/IndexerConfig/ConfigurationDataPinNumber.cs b/src/Jackett.Common/Models/IndexerConfig/ConfigurationDataPinNumber.cs index 95860854e..851cd65a0 100644 --- a/src/Jackett.Common/Models/IndexerConfig/ConfigurationDataPinNumber.cs +++ b/src/Jackett.Common/Models/IndexerConfig/ConfigurationDataPinNumber.cs @@ -4,6 +4,8 @@ namespace Jackett.Common.Models.IndexerConfig { public StringItem Pin { get; private set; } - public ConfigurationDataPinNumber() => Pin = new StringItem { Name = "Login Pin Number" }; + public ConfigurationDataPinNumber(string instructionMessageOptional = null) + : base (instructionMessageOptional) + => Pin = new StringItem { Name = "Login Pin Number" }; } }