Fixed: Parsing of some multi-season release names

This commit is contained in:
Mark McDowall 2021-11-28 17:50:44 -08:00
parent 226d94b050
commit f08f5cecdc
3 changed files with 6 additions and 5 deletions

View File

@ -62,10 +62,8 @@ namespace NzbDrone.Core.Test.ParserTests
Parser.Parser.ParseTitle(title).Quality.Quality.Should().NotBe(Quality.Unknown); Parser.Parser.ParseTitle(title).Quality.Quality.Should().NotBe(Quality.Unknown);
Parser.Parser.ParseTitle(title).Quality.SourceDetectionSource.Should().Be(QualityDetectionSource.Extension); Parser.Parser.ParseTitle(title).Quality.SourceDetectionSource.Should().Be(QualityDetectionSource.Extension);
Parser.Parser.ParseTitle(title).Quality.ResolutionDetectionSource.Should().Be(QualityDetectionSource.Extension); Parser.Parser.ParseTitle(title).Quality.ResolutionDetectionSource.Should().Be(QualityDetectionSource.Extension);
} }
[TestCase("Series.S01E02.Chained.Title.mkv", "Series.S01E02.Chained.Title")] [TestCase("Series.S01E02.Chained.Title.mkv", "Series.S01E02.Chained.Title")]
public void should_parse_releasetitle(string path, string releaseTitle) public void should_parse_releasetitle(string path, string releaseTitle)
{ {

View File

@ -81,7 +81,10 @@ namespace NzbDrone.Core.Test.ParserTests
} }
[TestCase("The Series S01-05 WS BDRip X264-REWARD-No Rars", "The Series", 1)] [TestCase("The Series S01-05 WS BDRip X264-REWARD-No Rars", "The Series", 1)]
[TestCase("Seinfault.S01-S09.1080p.AMZN.WEB-DL.DDP2.0.H.264-NTb", "Seinfault", 1)] [TestCase("Series.Title.S01-S09.1080p.AMZN.WEB-DL.DDP2.0.H.264-NTb", "Series Title", 1)]
[TestCase("Series Title S01 - S07 BluRay 1080p x264 REPACK -SacReD", "Series Title", 1)]
[TestCase("Series Title Season 01-07 BluRay 1080p x264 REPACK -SacReD", "Series Title", 1)]
[TestCase("Series Title Season 01 - Season 07 BluRay 1080p x264 REPACK -SacReD", "Series Title", 1)]
public void should_parse_multi_season_release(string postTitle, string title, int firstSeason) public void should_parse_multi_season_release(string postTitle, string title, int firstSeason)
{ {
var result = Parser.Parser.ParseTitle(postTitle); var result = Parser.Parser.ParseTitle(postTitle);

View File

@ -169,7 +169,7 @@ namespace NzbDrone.Core.Parser
RegexOptions.IgnoreCase | RegexOptions.Compiled), RegexOptions.IgnoreCase | RegexOptions.Compiled),
// Multi-season pack // Multi-season pack
new Regex(@"^(?<title>.+?)[-_. ]+S(?<season>(?<!\d+)(?:\d{1,2})(?!\d+))-S?(?<season>(?<!\d+)(?:\d{1,2})(?!\d+))", new Regex(@"^(?<title>.+?)[-_. ]+(?:S|Season[_. ]|Saison[_. ]|Series[_. ])(?<season>(?<!\d+)(?:\d{1,2})(?!\d+))(?:-|[-_. ]{3})(?:S|Season[_. ]|Saison[_. ]|Series[_. ])?(?<season>(?<!\d+)(?:\d{1,2})(?!\d+))",
RegexOptions.IgnoreCase | RegexOptions.Compiled), RegexOptions.IgnoreCase | RegexOptions.Compiled),
// Partial season pack // Partial season pack
@ -259,7 +259,7 @@ namespace NzbDrone.Core.Parser
RegexOptions.IgnoreCase | RegexOptions.Compiled), RegexOptions.IgnoreCase | RegexOptions.Compiled),
//Season only releases //Season only releases
new Regex(@"^(?<title>.+?)[-_. ]+?(?:S|Season|Saison|Series)[-_. ]?(?<season>\d{1,2}(?![-_. ]?\d+))(\W+|_|$)(?<extras>EXTRAS|SUBPACK)?(?!\\)", new Regex(@"^(?<title>.+?)[-_. ]+?(?:S|Season|Saison|Series)[-_. ]?(?<season>\d{1,2}(?![-_. ]?\d+))(?:[-_. ]|$)+(?<extras>EXTRAS|SUBPACK)?(?!\\)",
RegexOptions.IgnoreCase | RegexOptions.Compiled), RegexOptions.IgnoreCase | RegexOptions.Compiled),
//4 digit season only releases //4 digit season only releases