diff --git a/frontend/src/Settings/MediaManagement/Naming/NamingModal.js b/frontend/src/Settings/MediaManagement/Naming/NamingModal.js index 0008ab534..c66eff38b 100644 --- a/frontend/src/Settings/MediaManagement/Naming/NamingModal.js +++ b/frontend/src/Settings/MediaManagement/Naming/NamingModal.js @@ -63,7 +63,9 @@ const bookTokens = [ ]; const releaseDateTokens = [ - { token: '{Release Year}', example: '2016' } + { token: '{Release Year}', example: '2016' }, + { token: '{Release YearFirst}', example: '2015' }, + { token: '{Edition Year}', example: '2016' } ]; const qualityTokens = [ diff --git a/src/NzbDrone.Core/Organizer/FileNameBuilder.cs b/src/NzbDrone.Core/Organizer/FileNameBuilder.cs index cdbc6e684..f8f8cbf39 100644 --- a/src/NzbDrone.Core/Organizer/FileNameBuilder.cs +++ b/src/NzbDrone.Core/Organizer/FileNameBuilder.cs @@ -244,10 +244,32 @@ namespace NzbDrone.Core.Organizer { tokenHandlers["{Release Year}"] = m => edition.ReleaseDate.Value.Year.ToString(); } + else if (edition.Book.Value.ReleaseDate.HasValue) + { + tokenHandlers["{Release Year}"] = m => edition.Book.Value.ReleaseDate.Value.Year.ToString(); + } else { tokenHandlers["{Release Year}"] = m => "Unknown"; } + + if (edition.ReleaseDate.HasValue) + { + tokenHandlers["{Edition Year}"] = m => edition.ReleaseDate.Value.Year.ToString(); + } + else + { + tokenHandlers["{Edition Year}"] = m => "Unknown"; + } + + if (edition.Book.Value.ReleaseDate.HasValue) + { + tokenHandlers["{Release YearFirst}"] = m => edition.Book.Value.ReleaseDate.Value.Year.ToString(); + } + else + { + tokenHandlers["{Release YearFirst}"] = m => "Unknown"; + } } private void AddBookFileTokens(Dictionary> tokenHandlers, BookFile bookFile)