1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-11-09 12:32:31 +01:00

Fixed: Should allow space/period between season and episode number patterns in naming

This commit is contained in:
Mark McDowall 2014-10-27 07:38:53 -07:00
parent c4836975a9
commit 0e436f371b
3 changed files with 21 additions and 1 deletions

View File

@ -639,5 +639,23 @@ public void should_get_proper_filename_when_multi_episode_is_duplicated_and_brac
Subject.BuildFileName(new List<Episode> { _episode1, _episode2 }, _series, _episodeFile) Subject.BuildFileName(new List<Episode> { _episode1, _episode2 }, _series, _episodeFile)
.Should().Be("South Park - S15E06 - S15E07 - (HDTV-720p, , DRONE) - City Sushi"); .Should().Be("South Park - S15E06 - S15E07 - (HDTV-720p, , DRONE) - City Sushi");
} }
[Test]
public void should_allow_period_between_season_and_episode()
{
_namingConfig.StandardEpisodeFormat = "{Series.Title}.S{season:00}.E{episode:00}.{Episode.Title}";
Subject.BuildFileName(new List<Episode> { _episode1 }, _series, _episodeFile)
.Should().Be("South.Park.S15.E06.City.Sushi");
}
[Test]
public void should_allow_space_between_season_and_episode()
{
_namingConfig.StandardEpisodeFormat = "{Series Title} - S{season:00} E{episode:00} - {Episode Title}";
Subject.BuildFileName(new List<Episode> { _episode1 }, _series, _episodeFile)
.Should().Be("South Park - S15 E06 - City Sushi");
}
} }
} }

View File

@ -87,6 +87,8 @@ public class SingleEpisodeParserFixture : CoreTest
[TestCase("Shark Week S2009E09 [SDTV].avi", "Shark Week", 2009, 9)] [TestCase("Shark Week S2009E09 [SDTV].avi", "Shark Week", 2009, 9)]
[TestCase("St_Elsewhere_209_Aids_And_Comfort", "St Elsewhere", 2, 9)] [TestCase("St_Elsewhere_209_Aids_And_Comfort", "St Elsewhere", 2, 9)]
[TestCase("[Impatience] Locodol - 0x01 [720p][34073169].mkv", "Locodol", 0, 1)] [TestCase("[Impatience] Locodol - 0x01 [720p][34073169].mkv", "Locodol", 0, 1)]
[TestCase("South.Park.S15.E06.City.Sushi", "South Park", 15, 6)]
[TestCase("South Park - S15 E06 - City Sushi", "South Park", 15, 6)]
//[TestCase("", "", 0, 0)] //[TestCase("", "", 0, 0)]
public void should_parse_single_episode(string postTitle, string title, int seasonNumber, int episodeNumber) public void should_parse_single_episode(string postTitle, string title, int seasonNumber, int episodeNumber)
{ {

View File

@ -42,7 +42,7 @@ public class FileNameBuilder : IBuildFileNames
private static readonly Regex AbsoluteEpisodeRegex = new Regex(@"(?<absolute>\{absolute(?:\:0+)?})", private static readonly Regex AbsoluteEpisodeRegex = new Regex(@"(?<absolute>\{absolute(?:\:0+)?})",
RegexOptions.Compiled | RegexOptions.IgnoreCase); RegexOptions.Compiled | RegexOptions.IgnoreCase);
public static readonly Regex SeasonEpisodePatternRegex = new Regex(@"(?<separator>(?<=})[- ._]+?)?(?<seasonEpisode>s?{season(?:\:0+)?}(?<episodeSeparator>e|x)(?<episode>{episode(?:\:0+)?}))(?<separator>[- ._]+?(?={))?", public static readonly Regex SeasonEpisodePatternRegex = new Regex(@"(?<separator>(?<=})[- ._]+?)?(?<seasonEpisode>s?{season(?:\:0+)?}(?<episodeSeparator>[- ._]?[ex])(?<episode>{episode(?:\:0+)?}))(?<separator>[- ._]+?(?={))?",
RegexOptions.Compiled | RegexOptions.IgnoreCase); RegexOptions.Compiled | RegexOptions.IgnoreCase);
public static readonly Regex AbsoluteEpisodePatternRegex = new Regex(@"(?<separator>(?<=})[- ._]+?)?(?<absolute>{absolute(?:\:0+)?})(?<separator>[- ._]+?(?={))?", public static readonly Regex AbsoluteEpisodePatternRegex = new Regex(@"(?<separator>(?<=})[- ._]+?)?(?<absolute>{absolute(?:\:0+)?})(?<separator>[- ._]+?(?={))?",