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

pull/2/head
Qstick 5 years ago
parent de2ebba363
commit f59b391b28

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

@ -214,6 +214,12 @@ namespace NzbDrone.Core.Organizer
private void AddReleaseDateTokens(Dictionary<string, Func<TokenMatch, string>> tokenHandlers, int releaseYear) 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? tokenHandlers["{Release Year}"] = m => string.Format("{0}", releaseYear.ToString()); //Do I need m.CustomFormat?
} }

Loading…
Cancel
Save