diff --git a/IISExpress/AppServer/applicationhost.config b/IISExpress/AppServer/applicationhost.config
index ffcf44ec6..6c56a7b72 100644
--- a/IISExpress/AppServer/applicationhost.config
+++ b/IISExpress/AppServer/applicationhost.config
@@ -148,7 +148,7 @@
-
+
diff --git a/NzbDrone.Core.Test/ParserTest.cs b/NzbDrone.Core.Test/ParserTest.cs
index 7f332b1c5..46e4e34b4 100644
--- a/NzbDrone.Core.Test/ParserTest.cs
+++ b/NzbDrone.Core.Test/ParserTest.cs
@@ -13,7 +13,6 @@ namespace NzbDrone.Core.Test
public class ParserTest
{
[Test]
- [Row("WEEDS.S03E01-06.DUAL.BDRip.XviD.AC3.-HELLYWOOD", 3, 1)]
[Row("Two.and.a.Half.Me.103.720p.HDTV.X264-DIMENSION", 1, 3)]
[Row("Two.and.a.Half.Me.113.720p.HDTV.X264-DIMENSION", 1, 13)]
[Row("Two.and.a.Half.Me.1013.720p.HDTV.X264-DIMENSION", 10, 13)]
@@ -35,6 +34,18 @@ public void episode_parse(string path, int season, int episode)
Assert.AreEqual(episode, result[0].EpisodeNumber);
}
+ [Test]
+ [Row("The.Office.US.S03E01E02.DUAL.BDRip.XviD.AC3.-HELLYWOOD", 3, 1, 2)]
+ [Row("WEEDS.S03E01-06.DUAL.BDRip.XviD.AC3.-HELLYWOOD", 3, 1, 6)]
+ public void episode_parse_multi(string path, int season, int episodeOne, int episodeTwo)
+ {
+ var result = Parser.ParseEpisodeInfo(path);
+ Assert.Count(2, result);
+ Assert.AreEqual(season, result[0].SeasonNumber);
+ Assert.AreEqual(episodeOne, result[0].EpisodeNumber);
+ Assert.AreEqual(episodeTwo, result[1].EpisodeNumber);
+ }
+
[Test]
[Row("WEEDS.S03E01-06.DUAL.BDRip.XviD.AC3.-HELLYWOOD", QualityTypes.BDRip)]
[Row("WEEDS.S03E01-06.DUAL.BDRip.AC3.-HELLYWOOD", QualityTypes.BDRip)]
diff --git a/NzbDrone.Core/Parser.cs b/NzbDrone.Core/Parser.cs
index 8e1af4c82..5f348c232 100644
--- a/NzbDrone.Core/Parser.cs
+++ b/NzbDrone.Core/Parser.cs
@@ -18,7 +18,7 @@ internal static class Parser
private static readonly Regex[] ReportTitleRegex = new[]
{
- new Regex(@"(?.+?)?\W?(?\d+?)?\WS?(?\d+)(?:\-|\.|[a-z])(?\d+)\W(?!\\)", RegexOptions.IgnoreCase | RegexOptions.Compiled),
+ new Regex(@"(?.+?)?\W?(?\d+?)?\WS?(?\d+)((?:\-|\.|[a-z])(?\d+))+\W(?!\\)", RegexOptions.IgnoreCase | RegexOptions.Compiled),
new Regex(@"(?.+?)?\W?(?\d+?)?\WS?(?\d+)(?\d{2})\W(?!\\)", RegexOptions.IgnoreCase | RegexOptions.Compiled) //Supports 103/113 naming
};
@@ -58,18 +58,22 @@ internal static List ParseEpisodeInfo(string title)
foreach (Match matchGroup in match)
{
- var parsedEpisode = new EpisodeParseResult
- {
- SeriesTitle = seriesName,
- SeasonNumber = Convert.ToInt32(matchGroup.Groups["season"].Value),
- EpisodeNumber = Convert.ToInt32(matchGroup.Groups["episode"].Value),
- Year = year
- };
+ var seasonNumber = Convert.ToInt32(matchGroup.Groups["season"].Value);
+
+ foreach (Capture episode in matchGroup.Groups["episode"].Captures)
+ {
+ var parsedEpisode = new EpisodeParseResult
+ {
+ SeriesTitle = seriesName,
+ SeasonNumber = seasonNumber,
+ EpisodeNumber = Convert.ToInt32(episode.Value),
+ Year = year
+ };
- result.Add(parsedEpisode);
-
- Logger.Trace("Episode Parsed. {0}", parsedEpisode);
+ result.Add(parsedEpisode);
+ Logger.Trace("Episode Parsed. {0}", parsedEpisode);
+ }
}
break; //Break out of the for loop, we don't want to process every REGEX for each item otherwise we'll get duplicates
}
diff --git a/NzbDrone/app.config b/NzbDrone/app.config
index c0e72973b..81d395705 100644
--- a/NzbDrone/app.config
+++ b/NzbDrone/app.config
@@ -4,6 +4,6 @@
-
+
\ No newline at end of file