From 9839b482b2c0ec4b7a2895bd2077c239d41cb333 Mon Sep 17 00:00:00 2001 From: Bogdan Date: Wed, 26 Jul 2023 03:28:55 +0300 Subject: [PATCH] New: Support for specific locale in `Movie TitleFirstCharacter` naming token Fixes #8044 --- frontend/src/Settings/MediaManagement/Naming/NamingModal.js | 1 + src/NzbDrone.Core/Organizer/FileNameBuilder.cs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/frontend/src/Settings/MediaManagement/Naming/NamingModal.js b/frontend/src/Settings/MediaManagement/Naming/NamingModal.js index 90445f961..eda8716db 100644 --- a/frontend/src/Settings/MediaManagement/Naming/NamingModal.js +++ b/frontend/src/Settings/MediaManagement/Naming/NamingModal.js @@ -58,6 +58,7 @@ const movieTokens = [ { token: '{Movie OriginalTitle}', example: 'Τίτλος ταινίας' }, { token: '{Movie CleanOriginalTitle}', example: 'Τίτλος ταινίας' }, { token: '{Movie TitleFirstCharacter}', example: 'M' }, + { token: '{Movie TitleFirstCharacter:DE}', example: 'T' }, { token: '{Movie Collection}', example: 'The Movie Collection' }, { token: '{Movie Certification}', example: 'R' }, { token: '{Release Year}', example: '2009' } diff --git a/src/NzbDrone.Core/Organizer/FileNameBuilder.cs b/src/NzbDrone.Core/Organizer/FileNameBuilder.cs index bf897514f..ca9d84066 100644 --- a/src/NzbDrone.Core/Organizer/FileNameBuilder.cs +++ b/src/NzbDrone.Core/Organizer/FileNameBuilder.cs @@ -248,7 +248,7 @@ namespace NzbDrone.Core.Organizer tokenHandlers["{Movie Title}"] = m => GetLanguageTitle(movie, m.CustomFormat); tokenHandlers["{Movie CleanTitle}"] = m => CleanTitle(GetLanguageTitle(movie, m.CustomFormat)); tokenHandlers["{Movie TitleThe}"] = m => TitleThe(movie.Title); - tokenHandlers["{Movie TitleFirstCharacter}"] = m => TitleThe(movie.Title).Substring(0, 1).FirstCharToUpper(); + tokenHandlers["{Movie TitleFirstCharacter}"] = m => TitleThe(GetLanguageTitle(movie, m.CustomFormat)).Substring(0, 1).FirstCharToUpper(); tokenHandlers["{Movie OriginalTitle}"] = m => movie.MovieMetadata.Value.OriginalTitle ?? string.Empty; tokenHandlers["{Movie CleanOriginalTitle}"] = m => CleanTitle(movie.MovieMetadata.Value.OriginalTitle) ?? string.Empty;