New: Movie Collection naming token

pull/4926/head
Qstick 4 years ago
parent 4d193b2279
commit df197d2e16

@ -119,6 +119,7 @@ class NamingModal extends Component {
{ token: '{Movie CleanTitle}', example: 'Movie Title' },
{ token: '{Movie TitleThe}', example: 'Movie Title, The' },
{ token: '{Movie TitleFirstCharacter}', example: 'M' },
{ token: '{Movie Collection}', example: 'The Movie Collection' },
{ token: '{Movie Certification}', example: 'R' },
{ token: '{Release Year}', example: '2009' }
];

@ -198,6 +198,35 @@ namespace NzbDrone.Core.Test.OrganizerTests.FileNameBuilderTests
.Should().Be("South.Park.1997");
}
[Test]
public void should_replace_movie_certification()
{
_namingConfig.StandardMovieFormat = "{Movie Certification}";
_movie.Certification = "R";
Subject.BuildFileName(_movie, _movieFile)
.Should().Be("R");
}
[Test]
public void should_replace_movie_collection()
{
_namingConfig.StandardMovieFormat = "{Movie Collection}";
_movie.Collection = new MovieCollection { Name = "South Part Collection" };
Subject.BuildFileName(_movie, _movieFile)
.Should().Be("South Part Collection");
}
[Test]
public void should_be_empty_for_null_collection()
{
_namingConfig.StandardMovieFormat = "{Movie Collection}";
Subject.BuildFileName(_movie, _movieFile)
.Should().BeEmpty();
}
[Test]
public void should_replace_quality_title()
{

@ -234,6 +234,7 @@ namespace NzbDrone.Core.Organizer
tokenHandlers["{Movie TitleFirstCharacter}"] = m => TitleThe(movie.Title).Substring(0, 1).FirstCharToUpper();
tokenHandlers["{Movie Certification}"] = m => movie.Certification ?? string.Empty;
tokenHandlers["{Movie Collection}"] = m => movie.Collection?.Name ?? string.Empty;
}
private string GetLanguageTitle(Movie movie, string isoCodes)

@ -52,6 +52,8 @@ namespace NzbDrone.Core.Organizer
_movie = new Movie
{
Title = "The Movie: Title",
Collection = new MovieCollection { Name = "The Movie Collection", TmdbId = 123654 },
Certification = "R",
Year = 2010,
ImdbId = "tt0066921",
TmdbId = 345691,

Loading…
Cancel
Save