mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-10-02 16:52:04 +02:00
Fix: Series Titles with apostrophes when searched on NzbMatrix will now return valid results.
Each indexer can now override GetQueryTitle from IndexerBase if required for special title searching.
This commit is contained in:
@@ -17,6 +17,8 @@ namespace NzbDrone.Core.Providers.Indexer
|
||||
{
|
||||
}
|
||||
|
||||
private static readonly Regex TitleSearchRegex = new Regex(@"[\W]", RegexOptions.IgnoreCase | RegexOptions.Compiled);
|
||||
|
||||
protected override string[] Urls
|
||||
{
|
||||
get
|
||||
@@ -94,7 +96,6 @@ namespace NzbDrone.Core.Providers.Indexer
|
||||
get { return "NzbMatrix"; }
|
||||
}
|
||||
|
||||
|
||||
protected override string NzbDownloadUrl(SyndicationItem item)
|
||||
{
|
||||
return item.Links[0].Uri.ToString();
|
||||
@@ -110,5 +111,16 @@ namespace NzbDrone.Core.Providers.Indexer
|
||||
}
|
||||
return currentResult;
|
||||
}
|
||||
|
||||
public override string GetQueryTitle(string title)
|
||||
{
|
||||
//Replace apostrophe with empty string
|
||||
title = title.Replace("'", "");
|
||||
var cleanTitle = TitleSearchRegex.Replace(title, "+").Trim('+', ' ');
|
||||
|
||||
//remove any repeating +s
|
||||
cleanTitle = Regex.Replace(cleanTitle, @"\+{1,100}", "+");
|
||||
return cleanTitle;
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user