mirror of
https://github.com/Jackett/Jackett.git
synced 2025-10-03 00:47:21 +02:00
animebytes: remove the movie
from search term
This commit is contained in:
@@ -132,7 +132,7 @@ namespace Jackett.Common.Indexers
|
||||
{
|
||||
var releases = new List<ReleaseInfo>();
|
||||
|
||||
releases.AddRange(await GetResults(query, "anime", StripEpisodeNumber(query.SanitizedSearchTerm.Trim())));
|
||||
releases.AddRange(await GetResults(query, "anime", CleanSearchTerm(query.SanitizedSearchTerm.Trim())));
|
||||
|
||||
if (ContainsMusicCategories(query.Categories))
|
||||
{
|
||||
@@ -144,12 +144,14 @@ namespace Jackett.Common.Indexers
|
||||
.ToArray();
|
||||
}
|
||||
|
||||
private string StripEpisodeNumber(string term)
|
||||
private string CleanSearchTerm(string term)
|
||||
{
|
||||
// Tracer does not support searching with episode number so strip it if we have one
|
||||
term = Regex.Replace(term, @"\W(\dx)?\d?\d$", string.Empty);
|
||||
term = Regex.Replace(term, @"\W(S\d\d?E)?\d?\d$", string.Empty);
|
||||
term = Regex.Replace(term, @"\W\d+$", string.Empty);
|
||||
term = Regex.Replace(term, @"\W(\dx)?\d?\d$", string.Empty, RegexOptions.Compiled);
|
||||
term = Regex.Replace(term, @"\W(S\d\d?E)?\d?\d$", string.Empty, RegexOptions.Compiled);
|
||||
term = Regex.Replace(term, @"\W\d+$", string.Empty, RegexOptions.Compiled);
|
||||
|
||||
term = Regex.Replace(term.Trim(), @"\bThe Movie$", string.Empty, RegexOptions.Compiled | RegexOptions.IgnoreCase);
|
||||
|
||||
return term.Trim();
|
||||
}
|
||||
|
Reference in New Issue
Block a user