mirror of
https://github.com/Radarr/Radarr.git
synced 2024-11-04 10:02:40 +01:00
New: Movie Collection naming token
This commit is contained in:
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 @@ public void should_cleanup_Movie_Title()
|
||||
.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 @@ private void AddMovieTokens(Dictionary<string, Func<TokenMatch, string>> tokenHa
|
||||
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 @@ public FileNameSampleService(IBuildFileNames buildFileNames)
|
||||
_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…
Reference in New Issue
Block a user