From 217611d7165e2f24068697e4996f0dcfc54f786c Mon Sep 17 00:00:00 2001 From: Bogdan Date: Wed, 31 Jul 2024 07:28:01 +0300 Subject: [PATCH] Fixed: Persist Indexer Flags when manual importing from queue --- .../EpisodeImport/Manual/ManualImportService.cs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/NzbDrone.Core/MediaFiles/EpisodeImport/Manual/ManualImportService.cs b/src/NzbDrone.Core/MediaFiles/EpisodeImport/Manual/ManualImportService.cs index c413172aa..c82da9c78 100644 --- a/src/NzbDrone.Core/MediaFiles/EpisodeImport/Manual/ManualImportService.cs +++ b/src/NzbDrone.Core/MediaFiles/EpisodeImport/Manual/ManualImportService.cs @@ -215,6 +215,7 @@ namespace NzbDrone.Core.MediaFiles.EpisodeImport.Manual { DownloadClientItem downloadClientItem = null; Series series = null; + TrackedDownload trackedDownload = null; var directoryInfo = new DirectoryInfo(baseFolder); @@ -236,7 +237,7 @@ namespace NzbDrone.Core.MediaFiles.EpisodeImport.Manual if (downloadId.IsNotNullOrWhiteSpace()) { - var trackedDownload = _trackedDownloadService.Find(downloadId); + trackedDownload = _trackedDownloadService.Find(downloadId); downloadClientItem = trackedDownload.DownloadItem; if (series == null) @@ -272,6 +273,11 @@ namespace NzbDrone.Core.MediaFiles.EpisodeImport.Manual var seriesFiles = _diskScanService.FilterPaths(rootFolder, _diskScanService.GetVideoFiles(baseFolder).ToList()); var decisions = _importDecisionMaker.GetImportDecisions(seriesFiles, series, downloadClientItem, folderInfo, SceneSource(series, baseFolder), filterExistingFiles); + foreach (var decision in decisions) + { + decision.LocalEpisode.IndexerFlags = trackedDownload?.RemoteEpisode?.Release?.IndexerFlags ?? 0; + } + return decisions.Select(decision => MapItem(decision, rootFolder, downloadId, directoryInfo.Name)).ToList(); } @@ -331,7 +337,10 @@ namespace NzbDrone.Core.MediaFiles.EpisodeImport.Manual if (importDecisions.Any()) { - return MapItem(importDecisions.First(), rootFolder, downloadId, null); + var importDecision = importDecisions.First(); + importDecision.LocalEpisode.IndexerFlags = trackedDownload?.RemoteEpisode?.Release?.IndexerFlags ?? 0; + + return MapItem(importDecision, rootFolder, downloadId, null); } } catch (Exception ex)