diff --git a/src/NzbDrone.Core.Test/ParserTests/ParserFixture.cs b/src/NzbDrone.Core.Test/ParserTests/ParserFixture.cs
index ea35b5445..bb9475f5d 100644
--- a/src/NzbDrone.Core.Test/ParserTests/ParserFixture.cs
+++ b/src/NzbDrone.Core.Test/ParserTests/ParserFixture.cs
@@ -34,7 +34,7 @@ namespace NzbDrone.Core.Test.ParserTests
[TestCase("The.Girls.Next.Door.S03E06.DVDRip.XviD-WiDE", "The.Girls.Next.Door", 3, 6)]
[TestCase("Degrassi.S10E27.WS.DSR.XviD-2HD", "Degrassi", 10, 27)]
[TestCase("Parenthood.2010.S02E14.HDTV.XviD-LOL", "Parenthood 2010", 2, 14)]
- [TestCase("Hawaii Five 0 S01E19 720p WEB DL DD5 1 H 264 NT", "Hawaii Five", 1, 19)]
+ [TestCase("Hawaii Five 0 S01E19 720p WEB DL DD5 1 H 264 NT", "Hawaii Five 0", 1, 19)]
[TestCase("The Event S01E14 A Message Back 720p WEB DL DD5 1 H264 SURFER", "The Event", 1, 14)]
[TestCase("Adam Hills In Gordon St Tonight S01E07 WS PDTV XviD FUtV", "Adam Hills In Gordon St Tonight", 1, 7)]
[TestCase("Adam Hills In Gordon St Tonight S01E07 WS PDTV XviD FUtV", "Adam Hills In Gordon St Tonight", 1, 7)]
@@ -373,6 +373,9 @@ namespace NzbDrone.Core.Test.ParserTests
[TestCase("The Venture Bros. (2004)", "venturebros2004")]
[TestCase("Castle (2011)", "castle2011")]
[TestCase("Adventure Time S02 720p HDTV x264 CRON", "adventuretime")]
+ [TestCase("Hawaii Five 0", "hawaiifive0")]
+ [TestCase("Match of the Day", "matchday")]
+ [TestCase("Match of the Day 2", "matchday2")]
public void parse_series_name(string postTitle, string title)
{
var result = Parser.Parser.ParseSeriesName(postTitle);
@@ -412,7 +415,7 @@ namespace NzbDrone.Core.Test.ParserTests
result.Language.Should().Be(language);
}
- [TestCase("Hawaii Five 0 S01 720p WEB DL DD5 1 H 264 NT", "Hawaii Five", 1)]
+ [TestCase("Hawaii Five 0 S01 720p WEB DL DD5 1 H 264 NT", "Hawaii Five 0", 1)]
[TestCase("30 Rock S03 WS PDTV XviD FUtV", "30 Rock", 3)]
[TestCase("The Office Season 4 WS PDTV XviD FUtV", "The Office", 4)]
[TestCase("Eureka Season 1 720p WEB DL DD 5 1 h264 TjHD", "Eureka", 1)]
diff --git a/src/NzbDrone.Core/Housekeeping/Housekeepers/UpdateCleanTitleForSeries.cs b/src/NzbDrone.Core/Housekeeping/Housekeepers/UpdateCleanTitleForSeries.cs
new file mode 100644
index 000000000..b01e24ab2
--- /dev/null
+++ b/src/NzbDrone.Core/Housekeeping/Housekeepers/UpdateCleanTitleForSeries.cs
@@ -0,0 +1,32 @@
+using System.Linq;
+using NLog;
+using NzbDrone.Core.Parser;
+using NzbDrone.Core.Tv;
+
+namespace NzbDrone.Core.Housekeeping.Housekeepers
+{
+ public class UpdateCleanTitleForSeries : IHousekeepingTask
+ {
+ private readonly ISeriesRepository _seriesRepository;
+ private readonly Logger _logger;
+
+ public UpdateCleanTitleForSeries(ISeriesRepository seriesRepository, Logger logger)
+ {
+ _seriesRepository = seriesRepository;
+ _logger = logger;
+ }
+
+ public void Clean()
+ {
+ _logger.Trace("Updating CleanTitle for all series");
+
+ var series = _seriesRepository.All().ToList();
+
+ series.ForEach(s =>
+ {
+ s.CleanTitle = s.CleanTitle.CleanSeriesTitle();
+ _seriesRepository.Update(s);
+ });
+ }
+ }
+}
diff --git a/src/NzbDrone.Core/NzbDrone.Core.csproj b/src/NzbDrone.Core/NzbDrone.Core.csproj
index 5dbf4fd48..43c0f7b67 100644
--- a/src/NzbDrone.Core/NzbDrone.Core.csproj
+++ b/src/NzbDrone.Core/NzbDrone.Core.csproj
@@ -256,6 +256,7 @@
+
diff --git a/src/NzbDrone.Core/Parser/Parser.cs b/src/NzbDrone.Core/Parser/Parser.cs
index 21d88b971..1d24dea89 100644
--- a/src/NzbDrone.Core/Parser/Parser.cs
+++ b/src/NzbDrone.Core/Parser/Parser.cs
@@ -100,7 +100,7 @@ namespace NzbDrone.Core.Parser
RegexOptions.IgnoreCase | RegexOptions.Compiled)
};
- private static readonly Regex NormalizeRegex = new Regex(@"((^|\W|_)(a|an|the|and|or|of)($|\W|_))|\W|_|(?:(?<=[^0-9]+)|\b)(?!(?:19\d{2}|20\d{2}))\d+(?=[^0-9ip]+|\b)",
+ private static readonly Regex NormalizeRegex = new Regex(@"(\b(a|an|the|and|or|of)\b)|\W|_",
RegexOptions.IgnoreCase | RegexOptions.Compiled);
private static readonly Regex SimpleTitleRegex = new Regex(@"480[i|p]|720[i|p]|1080[i|p]|[x|h|x\s|h\s]264|DD\W?5\W1|\<|\>|\?|\*|\:|\|",