mirror of
https://github.com/Radarr/Radarr.git
synced 2024-08-16 15:29:40 +02:00
Add {Original Title} to FileNameBuilder. Fixes #103
This commit is contained in:
parent
ad147ed425
commit
53373e6f4a
@ -163,7 +163,7 @@ public string BuildFileName(Movie movie, MovieFile movieFile, NamingConfig namin
|
|||||||
AddReleaseDateTokens(tokenHandlers, movie.Year); //In case we want to separate the year
|
AddReleaseDateTokens(tokenHandlers, movie.Year); //In case we want to separate the year
|
||||||
AddQualityTokens(tokenHandlers, movie, movieFile);
|
AddQualityTokens(tokenHandlers, movie, movieFile);
|
||||||
AddMediaInfoTokens(tokenHandlers, movieFile);
|
AddMediaInfoTokens(tokenHandlers, movieFile);
|
||||||
AddReleaseGroupTokens(tokenHandlers, movie, movieFile);
|
AddMovieFileTokens(tokenHandlers, movieFile);
|
||||||
|
|
||||||
var fileName = ReplaceTokens(pattern, tokenHandlers, namingConfig).Trim();
|
var fileName = ReplaceTokens(pattern, tokenHandlers, namingConfig).Trim();
|
||||||
fileName = FileNameCleanupRegex.Replace(fileName, match => match.Captures[0].Value[0].ToString());
|
fileName = FileNameCleanupRegex.Replace(fileName, match => match.Captures[0].Value[0].ToString());
|
||||||
@ -504,6 +504,13 @@ private void AddEpisodeFileTokens(Dictionary<string, Func<TokenMatch, string>> t
|
|||||||
tokenHandlers["{Release Group}"] = m => episodeFile.ReleaseGroup ?? m.DefaultValue("Sonarr");
|
tokenHandlers["{Release Group}"] = m => episodeFile.ReleaseGroup ?? m.DefaultValue("Sonarr");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void AddMovieFileTokens(Dictionary<string, Func<TokenMatch, string>> tokenHandlers, MovieFile episodeFile)
|
||||||
|
{
|
||||||
|
tokenHandlers["{Original Title}"] = m => GetOriginalTitle(episodeFile);
|
||||||
|
tokenHandlers["{Original Filename}"] = m => GetOriginalFileName(episodeFile);
|
||||||
|
tokenHandlers["{Release Group}"] = m => episodeFile.ReleaseGroup ?? m.DefaultValue("Sonarr");
|
||||||
|
}
|
||||||
|
|
||||||
private void AddQualityTokens(Dictionary<string, Func<TokenMatch, string>> tokenHandlers, Series series, EpisodeFile episodeFile)
|
private void AddQualityTokens(Dictionary<string, Func<TokenMatch, string>> tokenHandlers, Series series, EpisodeFile episodeFile)
|
||||||
{
|
{
|
||||||
var qualityTitle = _qualityDefinitionService.Get(episodeFile.Quality.Quality).Title;
|
var qualityTitle = _qualityDefinitionService.Get(episodeFile.Quality.Quality).Title;
|
||||||
@ -528,13 +535,6 @@ private void AddQualityTokens(Dictionary<string, Func<TokenMatch, string>> token
|
|||||||
tokenHandlers["{Quality Real}"] = m => qualityReal;
|
tokenHandlers["{Quality Real}"] = m => qualityReal;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void AddReleaseGroupTokens(Dictionary<string, Func<TokenMatch, string>> tokenHandlers, Movie movie, MovieFile movieFile)
|
|
||||||
{
|
|
||||||
var releaseGroup = movieFile.ReleaseGroup;
|
|
||||||
|
|
||||||
tokenHandlers["{Release Group}"] = m => releaseGroup;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void AddMediaInfoTokens(Dictionary<string, Func<TokenMatch, string>> tokenHandlers, EpisodeFile episodeFile)
|
private void AddMediaInfoTokens(Dictionary<string, Func<TokenMatch, string>> tokenHandlers, EpisodeFile episodeFile)
|
||||||
{
|
{
|
||||||
if (episodeFile.MediaInfo == null) return;
|
if (episodeFile.MediaInfo == null) return;
|
||||||
|
Loading…
Reference in New Issue
Block a user