From 64ac67f58b804358c66b3e881149a267dd29bdfe Mon Sep 17 00:00:00 2001 From: kaso17 Date: Thu, 20 Dec 2018 15:57:41 +0100 Subject: [PATCH] BJShare: improve search --- src/Jackett.Common/Indexers/BJShare.cs | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/Jackett.Common/Indexers/BJShare.cs b/src/Jackett.Common/Indexers/BJShare.cs index 11524ae84..dfc474ca6 100644 --- a/src/Jackett.Common/Indexers/BJShare.cs +++ b/src/Jackett.Common/Indexers/BJShare.cs @@ -26,8 +26,9 @@ namespace Jackett.Common.Indexers private readonly char[] _digits = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9' }; private readonly Dictionary _commonSearchTerms = new Dictionary { - { "agents of shield", "Agents of S.H.I.E.L.D."} - }; + { "agents of shield", "Agents of S.H.I.E.L.D."}, + { "greys anatomy", "grey's anatomy"}, + }; public override string[] LegacySiteLinks { get; protected set; } = new string[] { "https://bj-share.me/" @@ -104,7 +105,8 @@ namespace Jackett.Common.Indexers { // Search does not support searching with episode numbers so strip it if we have one // Ww AND filter the result later to archive the proper result - return isAnime ? term.TrimEnd(_digits) : Regex.Replace(term, @"[S|E]\d\d", string.Empty).Trim(); + term = Regex.Replace(term, @"[S|E]\d\d", string.Empty).Trim(); + return isAnime ? term.TrimEnd(_digits) : term; } private static string FixAbsoluteNumbering(string title) @@ -126,8 +128,13 @@ namespace Jackett.Common.Indexers protected override async Task> PerformQuery(TorznabQuery query) { + query = query.Clone(); // avoid modifing the original query + + var releases = new List(); + + // if the search string is empty use the "last 24h torrents" view if (string.IsNullOrWhiteSpace(query.SearchTerm) && !query.IsImdbQuery) {