diff --git a/NzbDrone.Core.Test/ProviderTests/SabProviderTest.cs b/NzbDrone.Core.Test/ProviderTests/SabProviderTest.cs index f137691f1..d696787d9 100644 --- a/NzbDrone.Core.Test/ProviderTests/SabProviderTest.cs +++ b/NzbDrone.Core.Test/ProviderTests/SabProviderTest.cs @@ -271,10 +271,8 @@ public void IsInQueue_False_Error() [TestCase(1, new[] { 2, 4 }, "", QualityTypes.HDTV, true, "My Series Name - 1x2-1x4 - [HDTV] [Proper]")] public void sab_title(int seasons, int[] episodes, string title, QualityTypes quality, bool proper, string expected) { - - var series = Builder.CreateNew() - .With(c => c.Path = @"d:\tv shows\My Series Name") + .With(c => c.Title = "My Series Name") .Build(); var parsResult = new EpisodeParseResult() @@ -301,7 +299,7 @@ public void sab_season_title(bool proper, string expected) var series = Builder.CreateNew() - .With(c => c.Path = @"d:\tv shows\My Series Name") + .With(c => c.Title = "My Series Name") .Build(); var parsResult = new EpisodeParseResult() @@ -325,11 +323,9 @@ public void sab_season_title(bool proper, string expected) [TestCase(false, "My Series Name - 2011-12-01 - My Episode Title [Bluray720p]")] public void sab_daily_series_title(bool proper, string expected) { - - var series = Builder.CreateNew() - .With(c => c.Path = @"d:\tv shows\My Series Name") .With(c => c.IsDaily = true) + .With(c => c.Title = "My Series Name") .Build(); var parsResult = new EpisodeParseResult diff --git a/NzbDrone.Core/Providers/SabProvider.cs b/NzbDrone.Core/Providers/SabProvider.cs index d086cd378..d38c3aedb 100644 --- a/NzbDrone.Core/Providers/SabProvider.cs +++ b/NzbDrone.Core/Providers/SabProvider.cs @@ -108,7 +108,7 @@ public virtual String GetSabTitle(EpisodeParseResult parseResult) //Handle Full Naming if (parseResult.FullSeason) { - var seasonResult = String.Format("{0} - Season {1} [{2}]", new DirectoryInfo(parseResult.Series.Path).Name, + var seasonResult = String.Format("{0} - Season {1} [{2}]", MediaFileProvider.CleanFilename(parseResult.Series.Title), parseResult.SeasonNumber, parseResult.Quality.QualityType); if (parseResult.Quality.Proper) @@ -119,7 +119,7 @@ public virtual String GetSabTitle(EpisodeParseResult parseResult) if (parseResult.Series.IsDaily) { - var dailyResult = String.Format("{0} - {1:yyyy-MM-dd} - {2} [{3}]", new DirectoryInfo(parseResult.Series.Path).Name, + var dailyResult = String.Format("{0} - {1:yyyy-MM-dd} - {2} [{3}]", MediaFileProvider.CleanFilename(parseResult.Series.Title), parseResult.AirDate, parseResult.EpisodeTitle, parseResult.Quality.QualityType); if (parseResult.Quality.Proper) @@ -139,7 +139,7 @@ public virtual String GetSabTitle(EpisodeParseResult parseResult) var epNumberString = String.Join("-", episodeString); - var result = String.Format("{0} - {1} - {2} [{3}]", new DirectoryInfo(parseResult.Series.Path).Name, epNumberString, parseResult.EpisodeTitle, parseResult.Quality.QualityType); + var result = String.Format("{0} - {1} - {2} [{3}]", MediaFileProvider.CleanFilename(parseResult.Series.Title), epNumberString, parseResult.EpisodeTitle, parseResult.Quality.QualityType); if (parseResult.Quality.Proper) {