1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-09-11 12:02:35 +02:00

Fixed: Don't name with "0" year if no year in db

This commit is contained in:
Qstick 2020-05-25 01:05:42 -04:00
parent de2ebba363
commit f59b391b28
2 changed files with 8 additions and 1 deletions

View File

@ -117,7 +117,8 @@ class NamingModal extends Component {
{ token: '{Movie Title}', example: 'Movie Title!' },
{ token: '{Movie CleanTitle}', example: 'Movie Title' },
{ token: '{Movie TitleThe}', example: 'Movie Title, The' },
{ token: '{Movie Certification}', example: 'R' }
{ token: '{Movie Certification}', example: 'R' },
{ token: '{Release Year}', example: '2009' }
];
const movieIdTokens = [

View File

@ -214,6 +214,12 @@ private void AddTagsTokens(Dictionary<string, Func<TokenMatch, string>> tokenHan
private void AddReleaseDateTokens(Dictionary<string, Func<TokenMatch, string>> tokenHandlers, int releaseYear)
{
if (releaseYear == 0)
{
tokenHandlers["{Release Year}"] = m => string.Empty;
return;
}
tokenHandlers["{Release Year}"] = m => string.Format("{0}", releaseYear.ToString()); //Do I need m.CustomFormat?
}