mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-04-24 13:57:11 -04:00
Fixed: (AnimeBytes) Remove The Movie
from search term
This commit is contained in:
parent
c9249ed583
commit
d3ca861aea
1 changed files with 7 additions and 5 deletions
|
@ -141,7 +141,7 @@ namespace NzbDrone.Core.Indexers.Definitions
|
|||
var searchUrl = $"{_settings.BaseUrl.TrimEnd('/')}/scrape.php";
|
||||
|
||||
var term = searchCriteria.SanitizedSearchTerm.Trim();
|
||||
var searchTerm = StripEpisodeNumber(term);
|
||||
var searchTerm = CleanSearchTerm(term);
|
||||
|
||||
var parameters = new NameValueCollection
|
||||
{
|
||||
|
@ -188,12 +188,14 @@ namespace NzbDrone.Core.Indexers.Definitions
|
|||
yield return request;
|
||||
}
|
||||
|
||||
private static string StripEpisodeNumber(string term)
|
||||
private static 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();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue