From 2728bf79ca41bc372de515cb09e1034a8c006c2b Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Tue, 23 Feb 2021 18:39:24 -0800 Subject: [PATCH] New: Improve messaging if release is in queue because all episodes in release were not imported --- .../src/Activity/Queue/QueueStatusCell.css | 4 ++++ .../src/Activity/Queue/QueueStatusCell.js | 5 +++- .../Store/Actions/interactiveImportActions.js | 2 ++ .../Download/CompletedDownloadService.cs | 24 +++++++++++++++---- 4 files changed, 29 insertions(+), 6 deletions(-) diff --git a/frontend/src/Activity/Queue/QueueStatusCell.css b/frontend/src/Activity/Queue/QueueStatusCell.css index e1b9a23e9..538d5a15d 100644 --- a/frontend/src/Activity/Queue/QueueStatusCell.css +++ b/frontend/src/Activity/Queue/QueueStatusCell.css @@ -3,3 +3,7 @@ width: 30px; } + +.noMessages { + margin-bottom: 10px; +} diff --git a/frontend/src/Activity/Queue/QueueStatusCell.js b/frontend/src/Activity/Queue/QueueStatusCell.js index dc43130b4..32fa1d0a4 100644 --- a/frontend/src/Activity/Queue/QueueStatusCell.js +++ b/frontend/src/Activity/Queue/QueueStatusCell.js @@ -12,7 +12,10 @@ function getDetailedPopoverBody(statusMessages) { { statusMessages.map(({ title, messages }) => { return ( -
+
{title}
    { diff --git a/frontend/src/Store/Actions/interactiveImportActions.js b/frontend/src/Store/Actions/interactiveImportActions.js index 634b2adba..f967cae84 100644 --- a/frontend/src/Store/Actions/interactiveImportActions.js +++ b/frontend/src/Store/Actions/interactiveImportActions.js @@ -63,6 +63,8 @@ export const defaultState = { }; export const persistState = [ + 'interactiveImport.sortKey', + 'interactiveImport.sortDirection', 'interactiveImport.recentFolders', 'interactiveImport.importMode' ]; diff --git a/src/NzbDrone.Core/Download/CompletedDownloadService.cs b/src/NzbDrone.Core/Download/CompletedDownloadService.cs index 079e35ae5..6d83b04d6 100644 --- a/src/NzbDrone.Core/Download/CompletedDownloadService.cs +++ b/src/NzbDrone.Core/Download/CompletedDownloadService.cs @@ -126,16 +126,30 @@ public void Import(TrackedDownload trackedDownload) if (importResults.Empty()) { trackedDownload.Warn("No files found are eligible for import in {0}", outputPath); + + return; } + var statusMessages = new List + { + new TrackedDownloadStatusMessage("One or more episodes expected in this release were not imported or missing", new List()) + }; + if (importResults.Any(c => c.Result != ImportResultType.Imported)) { - var statusMessages = importResults - .Where(v => v.Result != ImportResultType.Imported && v.ImportDecision.LocalEpisode != null) - .Select(v => new TrackedDownloadStatusMessage(Path.GetFileName(v.ImportDecision.LocalEpisode.Path), v.Errors)) - .ToArray(); + statusMessages.AddRange( + importResults + .Where(v => v.Result != ImportResultType.Imported && v.ImportDecision.LocalEpisode != null) + .OrderBy(v => v.ImportDecision.LocalEpisode.Path) + .Select(v => + new TrackedDownloadStatusMessage(Path.GetFileName(v.ImportDecision.LocalEpisode.Path), + v.Errors)) + ); + } - trackedDownload.Warn(statusMessages); + if (statusMessages.Any()) + { + trackedDownload.Warn(statusMessages.ToArray()); } }