Fixed: Persist Indexer Flags when manual importing from queue

This commit is contained in:
Bogdan 2024-07-31 07:28:01 +03:00 committed by GitHub
parent 1299a97579
commit 217611d716
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 11 additions and 2 deletions

View File

@ -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)