fixes #865 - Series Season folders

This commit is contained in:
Luke Pulverenti 2014-07-04 21:22:26 -04:00
parent e2b3320f80
commit d6aee6a2ed
2 changed files with 8 additions and 0 deletions

View File

@ -129,6 +129,12 @@ namespace MediaBrowser.Controller.Library
return 0;
}
int val;
if (int.TryParse(filename, NumberStyles.Integer, CultureInfo.InvariantCulture, out val))
{
return val;
}
// Look for one of the season folder names
foreach (var name in SeasonFolderNames)
{

View File

@ -161,6 +161,8 @@ namespace MediaBrowser.Tests.Resolvers
Assert.AreEqual(1, TVUtils.GetSeasonNumberFromPath(@"\Drive\Season 1"));
Assert.AreEqual(1, TVUtils.GetSeasonNumberFromPath(@"\Drive\Season 1"));
Assert.AreEqual(2, TVUtils.GetSeasonNumberFromPath(@"\Drive\Seinfeld\2"));
//Four Digits seasons
Assert.AreEqual(2009, TVUtils.GetSeasonNumberFromPath(@"\Drive\Season 2009"));
Assert.AreEqual(2009, TVUtils.GetSeasonNumberFromPath(@"\Drive\Season 2009"));