SabProvider will use Series.Title instead of the series Path, it is first cleaned by MediaFileProvide.CleanName().

pull/4/head
Mark McDowall 13 years ago
parent 7ff53e5ac2
commit 3e9593ba3b

@ -271,10 +271,8 @@ namespace NzbDrone.Core.Test.ProviderTests
[TestCase(1, new[] { 2, 4 }, "", QualityTypes.HDTV, true, "My Series Name - 1x2-1x4 - [HDTV] [Proper]")] [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) public void sab_title(int seasons, int[] episodes, string title, QualityTypes quality, bool proper, string expected)
{ {
var series = Builder<Series>.CreateNew() var series = Builder<Series>.CreateNew()
.With(c => c.Path = @"d:\tv shows\My Series Name") .With(c => c.Title = "My Series Name")
.Build(); .Build();
var parsResult = new EpisodeParseResult() var parsResult = new EpisodeParseResult()
@ -301,7 +299,7 @@ namespace NzbDrone.Core.Test.ProviderTests
var series = Builder<Series>.CreateNew() var series = Builder<Series>.CreateNew()
.With(c => c.Path = @"d:\tv shows\My Series Name") .With(c => c.Title = "My Series Name")
.Build(); .Build();
var parsResult = new EpisodeParseResult() var parsResult = new EpisodeParseResult()
@ -325,11 +323,9 @@ namespace NzbDrone.Core.Test.ProviderTests
[TestCase(false, "My Series Name - 2011-12-01 - My Episode Title [Bluray720p]")] [TestCase(false, "My Series Name - 2011-12-01 - My Episode Title [Bluray720p]")]
public void sab_daily_series_title(bool proper, string expected) public void sab_daily_series_title(bool proper, string expected)
{ {
var series = Builder<Series>.CreateNew() var series = Builder<Series>.CreateNew()
.With(c => c.Path = @"d:\tv shows\My Series Name")
.With(c => c.IsDaily = true) .With(c => c.IsDaily = true)
.With(c => c.Title = "My Series Name")
.Build(); .Build();
var parsResult = new EpisodeParseResult var parsResult = new EpisodeParseResult

@ -108,7 +108,7 @@ namespace NzbDrone.Core.Providers
//Handle Full Naming //Handle Full Naming
if (parseResult.FullSeason) 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); parseResult.SeasonNumber, parseResult.Quality.QualityType);
if (parseResult.Quality.Proper) if (parseResult.Quality.Proper)
@ -119,7 +119,7 @@ namespace NzbDrone.Core.Providers
if (parseResult.Series.IsDaily) 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); parseResult.AirDate, parseResult.EpisodeTitle, parseResult.Quality.QualityType);
if (parseResult.Quality.Proper) if (parseResult.Quality.Proper)
@ -139,7 +139,7 @@ namespace NzbDrone.Core.Providers
var epNumberString = String.Join("-", episodeString); 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) if (parseResult.Quality.Proper)
{ {

Loading…
Cancel
Save