1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-11-04 10:02:40 +01:00

Fixed: Parsing separated season and episode numbers (S01 - E01)

Closes #1320
This commit is contained in:
Mark McDowall 2016-06-02 19:07:15 -07:00
parent b9d67ae421
commit c25bea6470
2 changed files with 5 additions and 0 deletions

View File

@ -120,6 +120,7 @@ public class SingleEpisodeParserFixture : CoreTest
[TestCase("Ken.Burns.The.Civil.War.5of9.The.Universe.Of.Battle.1990.DVDRip.x264-HANDJOB", "Ken Burns The Civil War", 1, 5)]
[TestCase("Judge Judy 2016 02 25 S20E142", "Judge Judy", 20, 142)]
[TestCase("Judge Judy 2016 02 25 S20E143", "Judge Judy", 20, 143)]
[TestCase("Red Dwarf - S02 - E06 - Parallel Universe", "Red Dwarf", 2, 6)]
//[TestCase("", "", 0, 0)]
public void should_parse_single_episode(string postTitle, string title, int seasonNumber, int episodeNumber)
{

View File

@ -114,6 +114,10 @@ public static class Parser
new Regex(@"^(?:(?<title>.+?)(?:_|-|\s|\.)+)(?:S?(?<season>(?<!\d+)\d{1,2}(?!\d+)))(?:(?:[-_. ]{1,3}ep){1,2}(?<episode>(?<!\d+)\d{5}(?!\d+)))+",
RegexOptions.IgnoreCase | RegexOptions.Compiled),
// Separated season and episode numbers S01 - E01
new Regex(@"^(?<title>.+?)\WS(?<season>\d{2}(?!\d+))(\W-\W)E(?<episode>(?<!\d+)\d{2}(?!\d+))(?!\\)",
RegexOptions.IgnoreCase | RegexOptions.Compiled),
//Season only releases
new Regex(@"^(?<title>.+?)\W(?:S|Season)\W?(?<season>\d{1,2}(?!\d+))(\W+|_|$)(?<extras>EXTRAS|SUBPACK)?(?!\\)",
RegexOptions.IgnoreCase | RegexOptions.Compiled),