mirror of
https://github.com/Radarr/Radarr.git
synced 2024-08-18 16:29:41 +02:00
Fixed: Matching of custom formats during movie file import
Closes #8287
This commit is contained in:
parent
836017c01b
commit
2a72a32d28
@ -117,7 +117,7 @@ public List<CustomFormat> ParseCustomFormat(LocalMovie localMovie)
|
||||
var episodeInfo = new ParsedMovieInfo
|
||||
{
|
||||
MovieTitles = new List<string>() { localMovie.Movie.Title },
|
||||
SimpleReleaseTitle = localMovie.SceneName?.SimplifyReleaseTitle(),
|
||||
SimpleReleaseTitle = localMovie.SceneName.IsNotNullOrWhiteSpace() ? localMovie.SceneName.SimplifyReleaseTitle() : Path.GetFileName(localMovie.Path).SimplifyReleaseTitle(),
|
||||
ReleaseTitle = localMovie.SceneName,
|
||||
Quality = localMovie.Quality,
|
||||
Edition = localMovie.Edition,
|
||||
@ -130,7 +130,8 @@ public List<CustomFormat> ParseCustomFormat(LocalMovie localMovie)
|
||||
MovieInfo = episodeInfo,
|
||||
Movie = localMovie.Movie,
|
||||
Size = localMovie.Size,
|
||||
Languages = localMovie.Languages
|
||||
Languages = localMovie.Languages,
|
||||
Filename = Path.GetFileName(localMovie.Path)
|
||||
};
|
||||
|
||||
return ParseCustomFormat(input);
|
||||
@ -166,24 +167,24 @@ private static List<CustomFormat> ParseCustomFormat(CustomFormatInput input, Lis
|
||||
|
||||
private static List<CustomFormat> ParseCustomFormat(MovieFile movieFile, Movie movie, List<CustomFormat> allCustomFormats)
|
||||
{
|
||||
var sceneName = string.Empty;
|
||||
var releaseTitle = string.Empty;
|
||||
if (movieFile.SceneName.IsNotNullOrWhiteSpace())
|
||||
{
|
||||
sceneName = movieFile.SceneName;
|
||||
releaseTitle = movieFile.SceneName;
|
||||
}
|
||||
else if (movieFile.OriginalFilePath.IsNotNullOrWhiteSpace())
|
||||
{
|
||||
sceneName = movieFile.OriginalFilePath;
|
||||
releaseTitle = movieFile.OriginalFilePath;
|
||||
}
|
||||
else if (movieFile.RelativePath.IsNotNullOrWhiteSpace())
|
||||
{
|
||||
sceneName = Path.GetFileName(movieFile.RelativePath);
|
||||
releaseTitle = Path.GetFileName(movieFile.RelativePath);
|
||||
}
|
||||
|
||||
var movieInfo = new ParsedMovieInfo
|
||||
{
|
||||
MovieTitles = new List<string>() { movie.Title },
|
||||
SimpleReleaseTitle = sceneName.SimplifyReleaseTitle(),
|
||||
SimpleReleaseTitle = releaseTitle.SimplifyReleaseTitle(),
|
||||
Quality = movieFile.Quality,
|
||||
Languages = movieFile.Languages,
|
||||
ReleaseGroup = movieFile.ReleaseGroup,
|
||||
|
Loading…
Reference in New Issue
Block a user