Fixed: Fixed issue where NzbMatrix servers would die if series title started with 'the'

This commit is contained in:
kay.one 2012-02-26 21:33:24 -08:00
commit 2303a02a06
3 changed files with 11 additions and 5 deletions

View file

@ -19,6 +19,7 @@ namespace NzbDrone.Core.Providers.Indexer
protected readonly ConfigProvider _configProvider;
private static readonly Regex TitleSearchRegex = new Regex(@"[\W]", RegexOptions.IgnoreCase | RegexOptions.Compiled);
protected static readonly Regex RemoveThe = new Regex(@"^the\s", RegexOptions.IgnoreCase | RegexOptions.Compiled);
[Inject]
protected IndexerBase(HttpProvider httpProvider, ConfigProvider configProvider)
@ -230,6 +231,8 @@ namespace NzbDrone.Core.Providers.Indexer
/// <returns></returns>
public virtual string GetQueryTitle(string title)
{
title = RemoveThe.Replace(title, string.Empty);
var cleanTitle = TitleSearchRegex.Replace(title, "+").Trim('+', ' ');
//remove any repeating +s