1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2024-12-14 11:23:42 +02:00

New: Improve messaging if release is in queue because all episodes in release were not imported

This commit is contained in:
Mark McDowall 2021-02-23 18:39:24 -08:00
parent cd28af98ee
commit 2728bf79ca
4 changed files with 29 additions and 6 deletions

View File

@ -3,3 +3,7 @@
width: 30px;
}
.noMessages {
margin-bottom: 10px;
}

View File

@ -12,7 +12,10 @@ function getDetailedPopoverBody(statusMessages) {
{
statusMessages.map(({ title, messages }) => {
return (
<div key={title}>
<div
key={title}
className={messages.length ? undefined: styles.noMessages}
>
{title}
<ul>
{

View File

@ -63,6 +63,8 @@ export const defaultState = {
};
export const persistState = [
'interactiveImport.sortKey',
'interactiveImport.sortDirection',
'interactiveImport.recentFolders',
'interactiveImport.importMode'
];

View File

@ -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<TrackedDownloadStatusMessage>
{
new TrackedDownloadStatusMessage("One or more episodes expected in this release were not imported or missing", new List<string>())
};
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());
}
}