1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2024-12-27 02:43:57 +02:00

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

View File

@ -215,6 +215,7 @@ private List<ManualImportItem> ProcessFolder(string rootFolder, string baseFolde
{
DownloadClientItem downloadClientItem = null;
Series series = null;
TrackedDownload trackedDownload = null;
var directoryInfo = new DirectoryInfo(baseFolder);
@ -236,7 +237,7 @@ private List<ManualImportItem> ProcessFolder(string rootFolder, string baseFolde
if (downloadId.IsNotNullOrWhiteSpace())
{
var trackedDownload = _trackedDownloadService.Find(downloadId);
trackedDownload = _trackedDownloadService.Find(downloadId);
downloadClientItem = trackedDownload.DownloadItem;
if (series == null)
@ -272,6 +273,11 @@ private List<ManualImportItem> ProcessFolder(string rootFolder, string baseFolde
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 @@ private ManualImportItem ProcessFile(string rootFolder, string baseFolder, strin
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)