|
|
|
@ -17,7 +17,7 @@ using NzbDrone.Core.Test.Framework;
|
|
|
|
|
namespace NzbDrone.Core.Test.OrganizerTests
|
|
|
|
|
{
|
|
|
|
|
[TestFixture]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public class MediaFileProvider_GetNewFilenameTest : CoreTest<FileNameBuilder>
|
|
|
|
|
{
|
|
|
|
|
private Series _series;
|
|
|
|
@ -45,7 +45,7 @@ namespace NzbDrone.Core.Test.OrganizerTests
|
|
|
|
|
[Test]
|
|
|
|
|
public void GetNewFilename_Series_Episode_Quality_S01E05_Dash()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -62,17 +62,17 @@ namespace NzbDrone.Core.Test.OrganizerTests
|
|
|
|
|
.With(e => e.EpisodeNumber = 6)
|
|
|
|
|
.Build();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
string result = Subject.BuildFilename(new List<Episode> { episode }, _series, new EpisodeFile { Quality = Quality.HDTV720p, Proper = false });
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
string result = Subject.BuildFilename(new List<Episode> { episode }, _series, new EpisodeFile { Quality = new QualityModel(Quality.HDTV720p) });
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Assert.AreEqual("South Park - S15E06 - City Sushi [HDTV-720p]", result);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
|
public void GetNewFilename_Episode_Quality_1x05_Dash()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -89,17 +89,17 @@ namespace NzbDrone.Core.Test.OrganizerTests
|
|
|
|
|
.With(e => e.EpisodeNumber = 6)
|
|
|
|
|
.Build();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
string result = Subject.BuildFilename(new List<Episode> { episode }, _series, new EpisodeFile { Quality = Quality.HDTV720p, Proper = false });
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
string result = Subject.BuildFilename(new List<Episode> { episode }, _series, new EpisodeFile { Quality = new QualityModel(Quality.HDTV720p) });
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Assert.AreEqual("15x06 - City Sushi [HDTV-720p]", result);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
|
public void GetNewFilename_Series_Quality_01x05_Space()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -116,17 +116,17 @@ namespace NzbDrone.Core.Test.OrganizerTests
|
|
|
|
|
.With(e => e.EpisodeNumber = 6)
|
|
|
|
|
.Build();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
string result = Subject.BuildFilename(new List<Episode> { episode }, _series, new EpisodeFile { Quality = Quality.HDTV720p, Proper = false });
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
string result = Subject.BuildFilename(new List<Episode> { episode }, _series, new EpisodeFile { Quality = new QualityModel(Quality.HDTV720p) });
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Assert.AreEqual("South Park 05x06 [HDTV-720p]", result);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
|
public void GetNewFilename_Series_s01e05_Space()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -144,17 +144,17 @@ namespace NzbDrone.Core.Test.OrganizerTests
|
|
|
|
|
.With(e => e.EpisodeNumber = 6)
|
|
|
|
|
.Build();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
string result = Subject.BuildFilename(new List<Episode> { episode }, _series, new EpisodeFile { Quality = Quality.HDTV720p, Proper = false });
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
string result = Subject.BuildFilename(new List<Episode> { episode }, _series, new EpisodeFile { Quality = new QualityModel(Quality.HDTV720p) });
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Assert.AreEqual("South Park s05e06", result);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
|
public void GetNewFilename_Series_Episode_s01e05_Periods()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -171,17 +171,17 @@ namespace NzbDrone.Core.Test.OrganizerTests
|
|
|
|
|
.With(e => e.EpisodeNumber = 6)
|
|
|
|
|
.Build();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
string result = Subject.BuildFilename(new List<Episode> { episode }, _series, new EpisodeFile { Quality = Quality.HDTV720p, Proper = false });
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
string result = Subject.BuildFilename(new List<Episode> { episode }, _series, new EpisodeFile { Quality = new QualityModel(Quality.HDTV720p) });
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Assert.AreEqual("South.Park.s05e06.City.Sushi", result);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
|
public void GetNewFilename_Series_Episode_s01e05_Dash_Periods_Quality()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -198,17 +198,17 @@ namespace NzbDrone.Core.Test.OrganizerTests
|
|
|
|
|
.With(e => e.EpisodeNumber = 6)
|
|
|
|
|
.Build();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
string result = Subject.BuildFilename(new List<Episode> { episode }, _series, new EpisodeFile { Quality = Quality.HDTV720p, Proper = false });
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
string result = Subject.BuildFilename(new List<Episode> { episode }, _series, new EpisodeFile { Quality = new QualityModel(Quality.HDTV720p) });
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Assert.AreEqual("South.Park.-.s05e06.-.City.Sushi.[HDTV-720p]", result);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
|
public void GetNewFilename_S01E05_Dash()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -226,17 +226,17 @@ namespace NzbDrone.Core.Test.OrganizerTests
|
|
|
|
|
.With(e => e.EpisodeNumber = 6)
|
|
|
|
|
.Build();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
string result = Subject.BuildFilename(new List<Episode> { episode }, _series, new EpisodeFile { Quality = Quality.HDTV720p, Proper = false });
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
string result = Subject.BuildFilename(new List<Episode> { episode }, _series, new EpisodeFile { Quality = new QualityModel(Quality.HDTV720p) });
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Assert.AreEqual("S15E06", result);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
|
public void GetNewFilename_multi_Series_Episode_Quality_S01E05_Scene_Dash()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -260,17 +260,17 @@ namespace NzbDrone.Core.Test.OrganizerTests
|
|
|
|
|
.With(e => e.EpisodeNumber = 24)
|
|
|
|
|
.Build();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
string result = Subject.BuildFilename(new List<Episode> { episodeOne, episodeTwo }, new Series { Title = "The Mentalist" }, new EpisodeFile { Quality = Quality.HDTV720p, Proper = false });
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
string result = Subject.BuildFilename(new List<Episode> { episodeOne, episodeTwo }, new Series { Title = "The Mentalist" }, new EpisodeFile { Quality = new QualityModel(Quality.HDTV720p) });
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Assert.AreEqual("The Mentalist - S03E23-E24 - Strawberries and Cream [HDTV-720p]", result);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
|
public void GetNewFilename_multi_Episode_Quality_1x05_Repeat_Dash()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -294,17 +294,17 @@ namespace NzbDrone.Core.Test.OrganizerTests
|
|
|
|
|
.With(e => e.EpisodeNumber = 24)
|
|
|
|
|
.Build();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
string result = Subject.BuildFilename(new List<Episode> { episodeOne, episodeTwo }, new Series { Title = "The Mentalist" }, new EpisodeFile { Quality = Quality.HDTV720p, Proper = false });
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
string result = Subject.BuildFilename(new List<Episode> { episodeOne, episodeTwo }, new Series { Title = "The Mentalist" }, new EpisodeFile { Quality = new QualityModel(Quality.HDTV720p) });
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Assert.AreEqual("3x23x24 - Strawberries and Cream [HDTV-720p]", result);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
|
public void GetNewFilename_multi_Episode_Quality_01x05_Repeat_Space()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -328,17 +328,17 @@ namespace NzbDrone.Core.Test.OrganizerTests
|
|
|
|
|
.With(e => e.EpisodeNumber = 24)
|
|
|
|
|
.Build();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
string result = Subject.BuildFilename(new List<Episode> { episodeOne, episodeTwo }, new Series { Title = "The Mentalist" }, new EpisodeFile { Quality = Quality.HDTV720p, Proper = false });
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
string result = Subject.BuildFilename(new List<Episode> { episodeOne, episodeTwo }, new Series { Title = "The Mentalist" }, new EpisodeFile { Quality = new QualityModel(Quality.HDTV720p) });
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Assert.AreEqual("3x23x24 Strawberries and Cream [HDTV-720p]", result);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
|
public void GetNewFilename_multi_Series_Episode_s01e05_Duplicate_Period()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -362,17 +362,17 @@ namespace NzbDrone.Core.Test.OrganizerTests
|
|
|
|
|
.With(e => e.EpisodeNumber = 24)
|
|
|
|
|
.Build();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
string result = Subject.BuildFilename(new List<Episode> { episodeOne, episodeTwo }, new Series { Title = "The Mentalist" }, new EpisodeFile { Quality = Quality.HDTV720p, Proper = false });
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
string result = Subject.BuildFilename(new List<Episode> { episodeOne, episodeTwo }, new Series { Title = "The Mentalist" }, new EpisodeFile { Quality = new QualityModel(Quality.HDTV720p) });
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Assert.AreEqual("The.Mentalist.s03e23.s03e24.Strawberries.and.Cream", result);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
|
public void GetNewFilename_multi_Series_S01E05_Extend_Dash_Period()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -396,17 +396,17 @@ namespace NzbDrone.Core.Test.OrganizerTests
|
|
|
|
|
.With(e => e.EpisodeNumber = 24)
|
|
|
|
|
.Build();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
string result = Subject.BuildFilename(new List<Episode> { episodeOne, episodeTwo }, new Series { Title = "The Mentalist" }, new EpisodeFile { Quality = Quality.HDTV720p, Proper = false });
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
string result = Subject.BuildFilename(new List<Episode> { episodeOne, episodeTwo }, new Series { Title = "The Mentalist" }, new EpisodeFile { Quality = new QualityModel(Quality.HDTV720p) });
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Assert.AreEqual("The.Mentalist.-.S03E23-24", result);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
|
public void GetNewFilename_multi_1x05_Repeat_Dash_Period()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -430,17 +430,17 @@ namespace NzbDrone.Core.Test.OrganizerTests
|
|
|
|
|
.With(e => e.EpisodeNumber = 24)
|
|
|
|
|
.Build();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
string result = Subject.BuildFilename(new List<Episode> { episodeOne, episodeTwo }, new Series { Title = "The Mentalist" }, new EpisodeFile { Quality = Quality.HDTV720p, Proper = false });
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
string result = Subject.BuildFilename(new List<Episode> { episodeOne, episodeTwo }, new Series { Title = "The Mentalist" }, new EpisodeFile { Quality = new QualityModel(Quality.HDTV720p) });
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Assert.AreEqual("3x23x24", result);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
|
public void GetNewFilename_should_append_proper_when_proper_and_append_quality_is_true()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
nameSpecification.IncludeSeriesName = true;
|
|
|
|
|
nameSpecification.IncludeEpisodeTitle = true;
|
|
|
|
@ -455,17 +455,17 @@ namespace NzbDrone.Core.Test.OrganizerTests
|
|
|
|
|
.With(e => e.EpisodeNumber = 6)
|
|
|
|
|
.Build();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
string result = Subject.BuildFilename(new List<Episode> { episode }, _series, new EpisodeFile { Quality = Quality.HDTV720p, Proper = true });
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
string result = Subject.BuildFilename(new List<Episode> { episode }, _series, new EpisodeFile { Quality = new QualityModel(Quality.HDTV720p, true) });
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
result.Should().Be("South Park - S15E06 - City Sushi [HDTV-720p] [Proper]");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
|
public void GetNewFilename_should_not_append_proper_when_not_proper_and_append_quality_is_true()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
nameSpecification.IncludeSeriesName = true;
|
|
|
|
|
nameSpecification.IncludeEpisodeTitle = true;
|
|
|
|
@ -480,17 +480,17 @@ namespace NzbDrone.Core.Test.OrganizerTests
|
|
|
|
|
.With(e => e.EpisodeNumber = 6)
|
|
|
|
|
.Build();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
string result = Subject.BuildFilename(new List<Episode> { episode }, _series, new EpisodeFile { Quality = Quality.HDTV720p, Proper = false });
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
string result = Subject.BuildFilename(new List<Episode> { episode }, _series, new EpisodeFile { Quality = new QualityModel(Quality.HDTV720p) });
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
result.Should().Be("South Park - S15E06 - City Sushi [HDTV-720p]");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
|
public void GetNewFilename_should_not_append_proper_when_proper_and_append_quality_is_false()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
nameSpecification.IncludeSeriesName = true;
|
|
|
|
|
nameSpecification.IncludeEpisodeTitle = true;
|
|
|
|
@ -505,17 +505,17 @@ namespace NzbDrone.Core.Test.OrganizerTests
|
|
|
|
|
.With(e => e.EpisodeNumber = 6)
|
|
|
|
|
.Build();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
string result = Subject.BuildFilename(new List<Episode> { episode }, _series, new EpisodeFile { Quality = Quality.HDTV720p, Proper = true });
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
string result = Subject.BuildFilename(new List<Episode> { episode }, _series, new EpisodeFile { Quality = new QualityModel(Quality.HDTV720p, true) });
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
result.Should().Be("South Park - S15E06 - City Sushi");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
|
public void GetNewFilename_should_order_multiple_episode_files_in_numerical_order()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
nameSpecification.IncludeSeriesName = true;
|
|
|
|
|
nameSpecification.IncludeEpisodeTitle = true;
|
|
|
|
@ -537,17 +537,17 @@ namespace NzbDrone.Core.Test.OrganizerTests
|
|
|
|
|
.With(e => e.EpisodeNumber = 7)
|
|
|
|
|
.Build();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
string result = Subject.BuildFilename(new List<Episode> { episode2, episode }, new Series { Title = "30 Rock" }, new EpisodeFile { Quality = Quality.HDTV720p, Proper = false });
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
string result = Subject.BuildFilename(new List<Episode> { episode2, episode }, new Series { Title = "30 Rock" }, new EpisodeFile { Quality = new QualityModel(Quality.HDTV720p) });
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
result.Should().Be("30 Rock - S06E06-E07 - Hey, Baby, What's Wrong!");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
|
public void GetNewFilename_Series_Episode_Quality_S01E05_Period()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -564,17 +564,17 @@ namespace NzbDrone.Core.Test.OrganizerTests
|
|
|
|
|
.With(e => e.EpisodeNumber = 6)
|
|
|
|
|
.Build();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
string result = Subject.BuildFilename(new List<Episode> { episode }, _series, new EpisodeFile { Quality = Quality.HDTV720p, Proper = false });
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
string result = Subject.BuildFilename(new List<Episode> { episode }, _series, new EpisodeFile { Quality = new QualityModel(Quality.HDTV720p) });
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Assert.AreEqual("South Park.S15E06.City Sushi [HDTV-720p]", result);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
|
public void GetNewFilename_Episode_Quality_1x05_Period()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -591,17 +591,17 @@ namespace NzbDrone.Core.Test.OrganizerTests
|
|
|
|
|
.With(e => e.EpisodeNumber = 6)
|
|
|
|
|
.Build();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
string result = Subject.BuildFilename(new List<Episode> { episode }, _series, new EpisodeFile { Quality = Quality.HDTV720p, Proper = false });
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
string result = Subject.BuildFilename(new List<Episode> { episode }, _series, new EpisodeFile { Quality = new QualityModel(Quality.HDTV720p) });
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Assert.AreEqual("15x06.City Sushi [HDTV-720p]", result);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
|
public void GetNewFilename_UseSceneName_when_sceneName_isNull()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
nameSpecification.IncludeSeriesName = false;
|
|
|
|
|
nameSpecification.IncludeEpisodeTitle = true;
|
|
|
|
@ -622,17 +622,17 @@ namespace NzbDrone.Core.Test.OrganizerTests
|
|
|
|
|
.With(e => e.Path = @"C:\Test\TV\30 Rock - S01E01 - Test")
|
|
|
|
|
.Build();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
string result = Subject.BuildFilename(new List<Episode> { episode }, _series, episodeFile);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
result.Should().Be(Path.GetFileNameWithoutExtension(episodeFile.Path));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
|
public void GetNewFilename_UseSceneName_when_sceneName_isNotNull()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
nameSpecification.IncludeSeriesName = false;
|
|
|
|
|
nameSpecification.IncludeEpisodeTitle = true;
|
|
|
|
@ -653,17 +653,17 @@ namespace NzbDrone.Core.Test.OrganizerTests
|
|
|
|
|
.With(e => e.Path = @"C:\Test\TV\30 Rock - S01E01 - Test")
|
|
|
|
|
.Build();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
string result = Subject.BuildFilename(new List<Episode> { episode }, _series, episodeFile);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
result.Should().Be(episodeFile.SceneName);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
|
public void should_only_have_one_episodeTitle_when_episode_titles_are_the_same()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
nameSpecification.IncludeSeriesName = true;
|
|
|
|
|
nameSpecification.IncludeEpisodeTitle = true;
|
|
|
|
@ -685,17 +685,17 @@ namespace NzbDrone.Core.Test.OrganizerTests
|
|
|
|
|
.With(e => e.EpisodeNumber = 7)
|
|
|
|
|
.Build();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
string result = Subject.BuildFilename(new List<Episode> { episode2, episode }, new Series { Title = "30 Rock" }, new EpisodeFile { Quality = Quality.HDTV720p, Proper = false });
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
string result = Subject.BuildFilename(new List<Episode> { episode2, episode }, new Series { Title = "30 Rock" }, new EpisodeFile { Quality = new QualityModel(Quality.HDTV720p) });
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
result.Should().Be("30 Rock - S06E06-E07 - Hey, Baby, What's Wrong!");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
|
public void should_have_two_episodeTitles_when_episode_titles_are_not_the_same()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
nameSpecification.IncludeSeriesName = true;
|
|
|
|
|
nameSpecification.IncludeEpisodeTitle = true;
|
|
|
|
@ -717,17 +717,17 @@ namespace NzbDrone.Core.Test.OrganizerTests
|
|
|
|
|
.With(e => e.EpisodeNumber = 7)
|
|
|
|
|
.Build();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
string result = Subject.BuildFilename(new List<Episode> { episode2, episode }, new Series { Title = "30 Rock" }, new EpisodeFile { Quality = Quality.HDTV720p, Proper = false });
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
string result = Subject.BuildFilename(new List<Episode> { episode2, episode }, new Series { Title = "30 Rock" }, new EpisodeFile { Quality = new QualityModel(Quality.HDTV720p) });
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
result.Should().Be("30 Rock - S06E06-E07 - Hello + World");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
|
public void should_have_two_episodeTitles_when_distinct_count_is_two()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
nameSpecification.IncludeSeriesName = true;
|
|
|
|
|
nameSpecification.IncludeEpisodeTitle = true;
|
|
|
|
@ -755,10 +755,10 @@ namespace NzbDrone.Core.Test.OrganizerTests
|
|
|
|
|
.With(e => e.EpisodeNumber = 8)
|
|
|
|
|
.Build();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
string result = Subject.BuildFilename(new List<Episode> { episode, episode2, episode3 }, new Series { Title = "30 Rock" }, new EpisodeFile { Quality = Quality.HDTV720p, Proper = false });
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
string result = Subject.BuildFilename(new List<Episode> { episode, episode2, episode3 }, new Series { Title = "30 Rock" }, new EpisodeFile { Quality = new QualityModel(Quality.HDTV720p) });
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
result.Should().Be("30 Rock - S06E06-E07-E08 - Hello + World");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -787,7 +787,7 @@ namespace NzbDrone.Core.Test.OrganizerTests
|
|
|
|
|
.Build();
|
|
|
|
|
|
|
|
|
|
var result = Subject
|
|
|
|
|
.BuildFilename(episodes, series, new EpisodeFile { Quality = Quality.HDTV720p, Proper = false });
|
|
|
|
|
.BuildFilename(episodes, series, new EpisodeFile { Quality = new QualityModel(Quality.HDTV720p) });
|
|
|
|
|
result.Should().Be("The Daily Show with Jon Stewart - 2012-12-13 - Kristen Stewart [HDTV-720p]");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -816,7 +816,7 @@ namespace NzbDrone.Core.Test.OrganizerTests
|
|
|
|
|
.Build();
|
|
|
|
|
|
|
|
|
|
var result = Subject
|
|
|
|
|
.BuildFilename(episodes, series, new EpisodeFile { Quality = Quality.HDTV720p, Proper = false });
|
|
|
|
|
.BuildFilename(episodes, series, new EpisodeFile { Quality = new QualityModel(Quality.HDTV720p) });
|
|
|
|
|
result.Should().Be("The Daily Show with Jon Stewart - 2012-12-13");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -845,7 +845,7 @@ namespace NzbDrone.Core.Test.OrganizerTests
|
|
|
|
|
.Build();
|
|
|
|
|
|
|
|
|
|
var result = Subject
|
|
|
|
|
.BuildFilename(episodes, series, new EpisodeFile { Quality = Quality.HDTV720p, Proper = false });
|
|
|
|
|
.BuildFilename(episodes, series, new EpisodeFile { Quality = new QualityModel(Quality.HDTV720p) });
|
|
|
|
|
result.Should().Be("The Daily Show with Jon Stewart - Unknown - Kristen Stewart");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|