From 965e7c22d948fe079d24a35cc30c17d995a162f1 Mon Sep 17 00:00:00 2001 From: Bogdan Date: Thu, 8 Feb 2024 00:25:20 +0200 Subject: [PATCH] Fixed: Reprocessing multi-language file in Manage Episodes --- .../Manual/ManualImportService.cs | 34 +++++++++---------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/src/NzbDrone.Core/MediaFiles/EpisodeImport/Manual/ManualImportService.cs b/src/NzbDrone.Core/MediaFiles/EpisodeImport/Manual/ManualImportService.cs index 19e7205e4..bd5393d4a 100644 --- a/src/NzbDrone.Core/MediaFiles/EpisodeImport/Manual/ManualImportService.cs +++ b/src/NzbDrone.Core/MediaFiles/EpisodeImport/Manual/ManualImportService.cs @@ -167,7 +167,7 @@ namespace NzbDrone.Core.MediaFiles.EpisodeImport.Manual localEpisode.ExistingFile = series.Path.IsParentPath(path); localEpisode.Size = _diskProvider.GetFileSize(path); localEpisode.ReleaseGroup = releaseGroup.IsNullOrWhiteSpace() ? Parser.Parser.ParseReleaseGroup(path) : releaseGroup; - localEpisode.Languages = (languages?.SingleOrDefault() ?? Language.Unknown) == Language.Unknown ? languageParse : languages; + localEpisode.Languages = languages?.Count <= 1 && (languages?.SingleOrDefault() ?? Language.Unknown) == Language.Unknown ? languageParse : languages; localEpisode.Quality = quality.Quality == Quality.Unknown ? QualityParser.ParseQuality(path) : quality; localEpisode.CustomFormats = _formatCalculator.ParseCustomFormat(localEpisode); localEpisode.CustomFormatScore = localEpisode.Series?.QualityProfile?.Value.CalculateCustomFormatScore(localEpisode.CustomFormats) ?? 0; @@ -183,22 +183,22 @@ namespace NzbDrone.Core.MediaFiles.EpisodeImport.Manual var downloadClientItem = GetTrackedDownload(downloadId)?.DownloadItem; var localEpisode = new LocalEpisode - { - Series = series, - Episodes = new List(), - FileEpisodeInfo = Parser.Parser.ParsePath(path), - DownloadClientEpisodeInfo = downloadClientItem == null - ? null - : Parser.Parser.ParseTitle(downloadClientItem.Title), - DownloadItem = downloadClientItem, - Path = path, - SceneSource = SceneSource(series, rootFolder), - ExistingFile = series.Path.IsParentPath(path), - Size = _diskProvider.GetFileSize(path), - ReleaseGroup = releaseGroup.IsNullOrWhiteSpace() ? Parser.Parser.ParseReleaseGroup(path) : releaseGroup, - Languages = (languages?.SingleOrDefault() ?? Language.Unknown) == Language.Unknown ? LanguageParser.ParseLanguages(path) : languages, - Quality = quality.Quality == Quality.Unknown ? QualityParser.ParseQuality(path) : quality - }; + { + Series = series, + Episodes = new List(), + FileEpisodeInfo = Parser.Parser.ParsePath(path), + DownloadClientEpisodeInfo = downloadClientItem == null + ? null + : Parser.Parser.ParseTitle(downloadClientItem.Title), + DownloadItem = downloadClientItem, + Path = path, + SceneSource = SceneSource(series, rootFolder), + ExistingFile = series.Path.IsParentPath(path), + Size = _diskProvider.GetFileSize(path), + ReleaseGroup = releaseGroup.IsNullOrWhiteSpace() ? Parser.Parser.ParseReleaseGroup(path) : releaseGroup, + Languages = languages?.Count <= 1 && (languages?.SingleOrDefault() ?? Language.Unknown) == Language.Unknown ? LanguageParser.ParseLanguages(path) : languages, + Quality = quality.Quality == Quality.Unknown ? QualityParser.ParseQuality(path) : quality + }; return MapItem(new ImportDecision(localEpisode, new Rejection("Episodes not selected")), rootFolder, downloadId, null); }