GetSabTitle will now handle daily episodes.

pull/4/head
Mark McDowall 13 years ago
parent 8de49bb112
commit dba5a1a236

@ -321,6 +321,32 @@ namespace NzbDrone.Core.Test.ProviderTests
Assert.AreEqual(expected, actual);
}
[TestCase(true, "My Series Name - 2011-12-01 - My Episode Title [Bluray720p] [Proper]")]
[TestCase(false, "My Series Name - 2011-12-01 - My Episode Title [Bluray720p]")]
public void sab_daily_series_title(bool proper, string expected)
{
var mocker = new AutoMoqer();
var series = Builder<Series>.CreateNew()
.With(c => c.Path = @"d:\tv shows\My Series Name")
.With(c => c.IsDaily = true)
.Build();
var parsResult = new EpisodeParseResult
{
AirDate = new DateTime(2011, 12,1),
Quality = new Quality(QualityTypes.Bluray720p, proper),
Series = series,
EpisodeTitle = "My Episode Title",
};
//Act
var actual = mocker.Resolve<SabProvider>().GetSabTitle(parsResult);
//Assert
Assert.AreEqual(expected, actual);
}
[Test]
[Explicit]
public void AddNewzbingByUrlSuccess()

@ -383,9 +383,7 @@
<Content Include="NzbDrone.ico" />
<Content Include="license.txt" />
</ItemGroup>
<ItemGroup>
<Folder Include="Providers\Jobs\" />
</ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PostBuildEvent>

@ -117,6 +117,17 @@ namespace NzbDrone.Core.Providers
return seasonResult;
}
if (parseResult.Series.IsDaily)
{
var dailyResult = String.Format("{0} - {1:yyyy-MM-dd} - {2} [{3}]", new DirectoryInfo(parseResult.Series.Path).Name,
parseResult.AirDate, parseResult.EpisodeTitle, parseResult.Quality.QualityType);
if (parseResult.Quality.Proper)
dailyResult += " [Proper]";
return dailyResult;
}
//Show Name - 1x01-1x02 - Episode Name
//Show Name - 1x01 - Episode Name
var episodeString = new List<String>();

Loading…
Cancel
Save