1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-11-05 02:22:31 +01:00

Fixed: Prevent error on manual import processing with multi languages

Closes #7713
This commit is contained in:
Qstick 2023-04-22 19:36:04 -05:00
parent 8a496cbdae
commit 890f9d6fe4
2 changed files with 6 additions and 4 deletions

View File

@ -121,8 +121,8 @@ public ManualImportItem ReprocessItem(string path, string downloadId, int movieI
SceneSource = SceneSource(movie, rootFolder), SceneSource = SceneSource(movie, rootFolder),
ExistingFile = movie.Path.IsParentPath(path), ExistingFile = movie.Path.IsParentPath(path),
Size = _diskProvider.GetFileSize(path), Size = _diskProvider.GetFileSize(path),
Languages = (languages?.SingleOrDefault() ?? Language.Unknown) == Language.Unknown ? languageParse : languages, Languages = languages?.Count <= 1 && (languages?.SingleOrDefault() ?? Language.Unknown) == Language.Unknown ? languageParse : languages,
Quality = quality.Quality == Quality.Unknown ? QualityParser.ParseQuality(path) : quality, Quality = (quality?.Quality ?? Quality.Unknown) == Quality.Unknown ? QualityParser.ParseQuality(path) : quality,
ReleaseGroup = releaseGroup.IsNullOrWhiteSpace() ? Parser.Parser.ParseReleaseGroup(path) : releaseGroup, ReleaseGroup = releaseGroup.IsNullOrWhiteSpace() ? Parser.Parser.ParseReleaseGroup(path) : releaseGroup,
}; };

View File

@ -35,7 +35,9 @@ public object ReprocessItems([FromBody] List<ManualImportReprocessResource> item
item.Movie = processedItem.Movie.ToResource(0); item.Movie = processedItem.Movie.ToResource(0);
item.Rejections = processedItem.Rejections; item.Rejections = processedItem.Rejections;
if (item.Languages.Single() == Language.Unknown)
if (item.Languages?.Count <= 1 && (item.Languages?.SingleOrDefault() ?? Language.Unknown) == Language.Unknown &&
processedItem.Languages.Any())
{ {
item.Languages = processedItem.Languages; item.Languages = processedItem.Languages;
} }
@ -45,7 +47,7 @@ public object ReprocessItems([FromBody] List<ManualImportReprocessResource> item
item.Quality = processedItem.Quality; item.Quality = processedItem.Quality;
} }
if (item.ReleaseGroup.IsNotNullOrWhiteSpace()) if (item.ReleaseGroup.IsNullOrWhiteSpace())
{ {
item.ReleaseGroup = processedItem.ReleaseGroup; item.ReleaseGroup = processedItem.ReleaseGroup;
} }