mirror of
https://github.com/lidarr/Lidarr
synced 2025-03-03 10:06:06 +00:00
GetSabTitle will now handle daily episodes.
This commit is contained in:
parent
8de49bb112
commit
dba5a1a236
3 changed files with 38 additions and 3 deletions
|
@ -321,6 +321,32 @@ public void sab_season_title(bool proper, string expected)
|
||||||
Assert.AreEqual(expected, actual);
|
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]
|
[Test]
|
||||||
[Explicit]
|
[Explicit]
|
||||||
public void AddNewzbingByUrlSuccess()
|
public void AddNewzbingByUrlSuccess()
|
||||||
|
|
|
@ -383,9 +383,7 @@
|
||||||
<Content Include="NzbDrone.ico" />
|
<Content Include="NzbDrone.ico" />
|
||||||
<Content Include="license.txt" />
|
<Content Include="license.txt" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup />
|
||||||
<Folder Include="Providers\Jobs\" />
|
|
||||||
</ItemGroup>
|
|
||||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<PostBuildEvent>
|
<PostBuildEvent>
|
||||||
|
|
|
@ -117,6 +117,17 @@ public virtual String GetSabTitle(EpisodeParseResult parseResult)
|
||||||
return seasonResult;
|
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-1x02 - Episode Name
|
||||||
//Show Name - 1x01 - Episode Name
|
//Show Name - 1x01 - Episode Name
|
||||||
var episodeString = new List<String>();
|
var episodeString = new List<String>();
|
||||||
|
|
Loading…
Reference in a new issue