Fixed: Removed support for movie file tokens in Movie Folder Format

This commit is contained in:
Bogdan 2025-05-13 13:56:54 +03:00 committed by bakerboy448
parent 84593502a3
commit f04bff8e91
3 changed files with 3 additions and 21 deletions

View file

@ -30,7 +30,7 @@ public override HealthCheck Check()
{ {
return new HealthCheck( return new HealthCheck(
GetType(), GetType(),
HealthCheckResult.Warning, HealthCheckResult.Error,
_localizationService.GetLocalizedString( _localizationService.GetLocalizedString(
"NamingConfigMovieFolderFormatDeprecatedHealthCheckMessage", new Dictionary<string, object> "NamingConfigMovieFolderFormatDeprecatedHealthCheckMessage", new Dictionary<string, object>
{ {

View file

@ -174,29 +174,13 @@ public string GetMovieFolder(Movie movie, NamingConfig namingConfig = null)
namingConfig = _namingConfigService.GetConfig(); namingConfig = _namingConfigService.GetConfig();
} }
var pattern = namingConfig.MovieFolderFormat;
var multipleTokens = TitleRegex.Matches(pattern).Count > 1;
var tokenHandlers = new Dictionary<string, Func<TokenMatch, string>>(FileNameBuilderTokenEqualityComparer.Instance); var tokenHandlers = new Dictionary<string, Func<TokenMatch, string>>(FileNameBuilderTokenEqualityComparer.Instance);
AddMovieTokens(tokenHandlers, movie); AddMovieTokens(tokenHandlers, movie);
AddReleaseDateTokens(tokenHandlers, movie.Year); AddReleaseDateTokens(tokenHandlers, movie.Year);
AddIdTokens(tokenHandlers, movie); AddIdTokens(tokenHandlers, movie);
var movieFile = movie.MovieFile; var pattern = namingConfig.MovieFolderFormat;
if (movie.MovieFile != null)
{
AddQualityTokens(tokenHandlers, movie, movieFile);
AddMediaInfoTokens(tokenHandlers, movieFile);
AddMovieFileTokens(tokenHandlers, movieFile, multipleTokens);
AddEditionTagsTokens(tokenHandlers, movieFile);
}
else
{
AddMovieFileTokens(tokenHandlers, new MovieFile { SceneName = $"{movie.Title} {movie.Year}", RelativePath = $"{movie.Title} {movie.Year}" }, multipleTokens);
}
var splitPatterns = pattern.Split(new char[] { '\\', '/' }, StringSplitOptions.RemoveEmptyEntries); var splitPatterns = pattern.Split(new char[] { '\\', '/' }, StringSplitOptions.RemoveEmptyEntries);
var components = new List<string>(); var components = new List<string>();

View file

@ -60,9 +60,7 @@ protected override bool IsValid(PropertyValidatorContext context)
return false; return false;
} }
// TODO: Deprecate OriginalTokenRegex use for Movie Folder Format return FileNameBuilder.MovieTitleRegex.IsMatch(value);
return FileNameBuilder.MovieTitleRegex.IsMatch(value) ||
FileNameValidation.OriginalTokenRegex.IsMatch(value);
} }
} }