mirror of
https://github.com/Radarr/Radarr
synced 2025-12-06 08:28:50 +01:00
Looks like TitleThe freaks out on a null string; use a wrapping method for {Movie CollectionThe}
This commit is contained in:
parent
b59ff0a3b1
commit
235699070e
1 changed files with 13 additions and 1 deletions
|
|
@ -211,6 +211,18 @@ public static string CleanTitle(string title)
|
|||
return title.RemoveDiacritics();
|
||||
}
|
||||
|
||||
public static string CollectionTitleThe(string collectionTitle)
|
||||
{
|
||||
if (string.IsNullOrEmpty(collectionTitle))
|
||||
{
|
||||
return string.Empty;
|
||||
}
|
||||
else
|
||||
{
|
||||
return TitleThe(collectionTitle);
|
||||
}
|
||||
}
|
||||
|
||||
public static string TitleThe(string title)
|
||||
{
|
||||
return TitlePrefixRegex.Replace(title, "$2, $1$3");
|
||||
|
|
@ -268,7 +280,7 @@ private void AddMovieTokens(Dictionary<string, Func<TokenMatch, string>> tokenHa
|
|||
|
||||
tokenHandlers["{Movie Certification}"] = m => movie.MovieMetadata.Value.Certification ?? string.Empty;
|
||||
tokenHandlers["{Movie Collection}"] = m => Truncate(movie.MovieMetadata.Value.CollectionTitle, m.CustomFormat) ?? string.Empty;
|
||||
tokenHandlers["{Movie CollectionThe}"] = m => Truncate(TitleThe(movie.MovieMetadata.Value.CollectionTitle), m.CustomFormat) ?? string.Empty;
|
||||
tokenHandlers["{Movie CollectionThe}"] = m => Truncate(CollectionTitleThe(movie.MovieMetadata.Value.CollectionTitle), m.CustomFormat) ?? string.Empty;
|
||||
}
|
||||
|
||||
private string GetLanguageTitle(Movie movie, string isoCodes)
|
||||
|
|
|
|||
Loading…
Reference in a new issue