diff --git a/frontend/src/Settings/MediaManagement/Naming/NamingModal.js b/frontend/src/Settings/MediaManagement/Naming/NamingModal.js index 3910ac95d..a2a59469c 100644 --- a/frontend/src/Settings/MediaManagement/Naming/NamingModal.js +++ b/frontend/src/Settings/MediaManagement/Naming/NamingModal.js @@ -116,8 +116,10 @@ class NamingModal extends Component { const movieTokens = [ { token: '{Movie Title}', example: 'Movie Title!' }, + { token: '{Movie Title:DE}', example: 'Filetitle' }, { token: '{Movie CleanTitle}', example: 'Movie Title' }, { token: '{Movie TitleThe}', example: 'Movie Title, The' }, + { token: '{Movie OriginalTitle}', example: 'Τίτλος ταινίας' }, { token: '{Movie TitleFirstCharacter}', example: 'M' }, { token: '{Movie Collection}', example: 'The Movie Collection' }, { token: '{Movie Certification}', example: 'R' }, diff --git a/src/NzbDrone.Core.Test/OrganizerTests/FileNameBuilderTests/FileNameBuilderFixture.cs b/src/NzbDrone.Core.Test/OrganizerTests/FileNameBuilderTests/FileNameBuilderFixture.cs index bdbbf31dd..4218503b0 100644 --- a/src/NzbDrone.Core.Test/OrganizerTests/FileNameBuilderTests/FileNameBuilderFixture.cs +++ b/src/NzbDrone.Core.Test/OrganizerTests/FileNameBuilderTests/FileNameBuilderFixture.cs @@ -47,6 +47,7 @@ namespace NzbDrone.Core.Test.OrganizerTests.FileNameBuilderTests _movie = Builder .CreateNew() .With(s => s.Title = "South Park") + .With(s => s.OriginalTitle = "South of the Park") .Build(); _namingConfig = NamingConfig.Default; @@ -198,6 +199,16 @@ namespace NzbDrone.Core.Test.OrganizerTests.FileNameBuilderTests .Should().Be("South.Park.1997"); } + [Test] + public void should_replace_movie_original_title() + { + _namingConfig.StandardMovieFormat = "{Movie OriginalTitle}"; + _movie.OriginalTitle = "South of the Park"; + + Subject.BuildFileName(_movie, _movieFile) + .Should().Be("South of the Park"); + } + [Test] public void should_replace_movie_certification() { diff --git a/src/NzbDrone.Core/Organizer/FileNameBuilder.cs b/src/NzbDrone.Core/Organizer/FileNameBuilder.cs index c6cd11eb9..b3385e478 100644 --- a/src/NzbDrone.Core/Organizer/FileNameBuilder.cs +++ b/src/NzbDrone.Core/Organizer/FileNameBuilder.cs @@ -50,7 +50,7 @@ namespace NzbDrone.Core.Organizer public static readonly Regex AirDateRegex = new Regex(@"\{Air(\s|\W|_)Date\}", RegexOptions.Compiled | RegexOptions.IgnoreCase); - public static readonly Regex MovieTitleRegex = new Regex(@"(?\{((?:(Movie|Original))(?[- ._])(Clean)?(Title|Filename)(The)?)(?::(?[a-z0-9|]+))?\})", + public static readonly Regex MovieTitleRegex = new Regex(@"(?\{((?:(Movie|Original))(?[- ._])(Clean|Original)?(Title|Filename)(The)?)(?::(?[a-z0-9|]+))?\})", RegexOptions.Compiled | RegexOptions.IgnoreCase); private static readonly Regex FileNameCleanupRegex = new Regex(@"([- ._])(\1)+", RegexOptions.Compiled); @@ -232,6 +232,7 @@ namespace NzbDrone.Core.Organizer tokenHandlers["{Movie CleanTitle}"] = m => CleanTitle(GetLanguageTitle(movie, m.CustomFormat)); tokenHandlers["{Movie Title The}"] = m => TitleThe(movie.Title); tokenHandlers["{Movie TitleFirstCharacter}"] = m => TitleThe(movie.Title).Substring(0, 1).FirstCharToUpper(); + tokenHandlers["{Movie OriginalTitle}"] = m => movie.OriginalTitle ?? string.Empty; tokenHandlers["{Movie Certification}"] = m => movie.Certification ?? string.Empty; tokenHandlers["{Movie Collection}"] = m => movie.Collection?.Name ?? string.Empty;