Fixed: Reprocessing multi-language file in Manage Episodes

This commit is contained in:
Bogdan 2024-02-08 00:25:20 +02:00 committed by Mark McDowall
parent 75535e61d9
commit 965e7c22d9
1 changed files with 17 additions and 17 deletions

View File

@ -167,7 +167,7 @@ namespace NzbDrone.Core.MediaFiles.EpisodeImport.Manual
localEpisode.ExistingFile = series.Path.IsParentPath(path); localEpisode.ExistingFile = series.Path.IsParentPath(path);
localEpisode.Size = _diskProvider.GetFileSize(path); localEpisode.Size = _diskProvider.GetFileSize(path);
localEpisode.ReleaseGroup = releaseGroup.IsNullOrWhiteSpace() ? Parser.Parser.ParseReleaseGroup(path) : releaseGroup; 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.Quality = quality.Quality == Quality.Unknown ? QualityParser.ParseQuality(path) : quality;
localEpisode.CustomFormats = _formatCalculator.ParseCustomFormat(localEpisode); localEpisode.CustomFormats = _formatCalculator.ParseCustomFormat(localEpisode);
localEpisode.CustomFormatScore = localEpisode.Series?.QualityProfile?.Value.CalculateCustomFormatScore(localEpisode.CustomFormats) ?? 0; 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 downloadClientItem = GetTrackedDownload(downloadId)?.DownloadItem;
var localEpisode = new LocalEpisode var localEpisode = new LocalEpisode
{ {
Series = series, Series = series,
Episodes = new List<Episode>(), Episodes = new List<Episode>(),
FileEpisodeInfo = Parser.Parser.ParsePath(path), FileEpisodeInfo = Parser.Parser.ParsePath(path),
DownloadClientEpisodeInfo = downloadClientItem == null DownloadClientEpisodeInfo = downloadClientItem == null
? null ? null
: Parser.Parser.ParseTitle(downloadClientItem.Title), : Parser.Parser.ParseTitle(downloadClientItem.Title),
DownloadItem = downloadClientItem, DownloadItem = downloadClientItem,
Path = path, Path = path,
SceneSource = SceneSource(series, rootFolder), SceneSource = SceneSource(series, rootFolder),
ExistingFile = series.Path.IsParentPath(path), ExistingFile = series.Path.IsParentPath(path),
Size = _diskProvider.GetFileSize(path), Size = _diskProvider.GetFileSize(path),
ReleaseGroup = releaseGroup.IsNullOrWhiteSpace() ? Parser.Parser.ParseReleaseGroup(path) : releaseGroup, ReleaseGroup = releaseGroup.IsNullOrWhiteSpace() ? Parser.Parser.ParseReleaseGroup(path) : releaseGroup,
Languages = (languages?.SingleOrDefault() ?? Language.Unknown) == Language.Unknown ? LanguageParser.ParseLanguages(path) : languages, Languages = languages?.Count <= 1 && (languages?.SingleOrDefault() ?? Language.Unknown) == Language.Unknown ? LanguageParser.ParseLanguages(path) : languages,
Quality = quality.Quality == Quality.Unknown ? QualityParser.ParseQuality(path) : quality Quality = quality.Quality == Quality.Unknown ? QualityParser.ParseQuality(path) : quality
}; };
return MapItem(new ImportDecision(localEpisode, new Rejection("Episodes not selected")), rootFolder, downloadId, null); return MapItem(new ImportDecision(localEpisode, new Rejection("Episodes not selected")), rootFolder, downloadId, null);
} }