BJShare: improve search

This commit is contained in:
kaso17 2018-12-20 15:57:41 +01:00
parent 6735ad030d
commit 64ac67f58b
1 changed files with 10 additions and 3 deletions

View File

@ -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<string, string> _commonSearchTerms = new Dictionary<string, string>
{
{ "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<IEnumerable<ReleaseInfo>> PerformQuery(TorznabQuery query)
{
query = query.Clone(); // avoid modifing the original query
var releases = new List<ReleaseInfo>();
// if the search string is empty use the "last 24h torrents" view
if (string.IsNullOrWhiteSpace(query.SearchTerm) && !query.IsImdbQuery)
{