1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-10-03 22:57:18 +02:00

New: Improve UI status when downloads cannot be imported automatically

(cherry picked from commit 6d5ff9c4d6993d16848980aea499a45b1b51d95c)

Closes #10107
This commit is contained in:
Mark McDowall 2024-06-25 15:51:20 -07:00 committed by Bogdan
parent fcb0d8a930
commit 7bdb3e437d
5 changed files with 17 additions and 8 deletions

View File

@ -70,6 +70,11 @@ function QueueStatus(props) {
iconName = icons.DOWNLOADED; iconName = icons.DOWNLOADED;
title = translate('Downloaded'); title = translate('Downloaded');
if (trackedDownloadState === 'importBlocked') {
title += ` - ${translate('UnableToImportAutomatically')}`;
iconKind = kinds.WARNING;
}
if (trackedDownloadState === 'importPending') { if (trackedDownloadState === 'importPending') {
title += ` - ${translate('WaitingToImport')}`; title += ` - ${translate('WaitingToImport')}`;
iconKind = kinds.PURPLE; iconKind = kinds.PURPLE;

View File

@ -207,7 +207,7 @@ private void AssertNotImported()
Mocker.GetMock<IEventAggregator>() Mocker.GetMock<IEventAggregator>()
.Verify(v => v.PublishEvent(It.IsAny<DownloadCompletedEvent>()), Times.Never()); .Verify(v => v.PublishEvent(It.IsAny<DownloadCompletedEvent>()), Times.Never());
_trackedDownload.State.Should().Be(TrackedDownloadState.ImportPending); _trackedDownload.State.Should().Be(TrackedDownloadState.ImportBlocked);
} }
private void AssertImported() private void AssertImported()

View File

@ -63,8 +63,8 @@ public void Check(TrackedDownload trackedDownload)
SetImportItem(trackedDownload); SetImportItem(trackedDownload);
// Only process tracked downloads that are still downloading // Only process tracked downloads that are still downloading or have been blocked for importing due to an issue with matching
if (trackedDownload.State != TrackedDownloadState.Downloading) if (trackedDownload.State != TrackedDownloadState.Downloading && trackedDownload.State != TrackedDownloadState.ImportBlocked)
{ {
return; return;
} }
@ -95,7 +95,7 @@ public void Check(TrackedDownload trackedDownload)
if (movie == null) if (movie == null)
{ {
trackedDownload.Warn("Movie title mismatch, automatic import is not possible. Manual Import required."); trackedDownload.Warn("Movie title mismatch, automatic import is not possible. Manual Import required.");
SendManualInteractionRequiredNotification(trackedDownload); SetStateToImportBlocked(trackedDownload);
return; return;
} }
@ -107,7 +107,7 @@ public void Check(TrackedDownload trackedDownload)
if (movieMatchType == MovieMatchType.Id && releaseSource != ReleaseSourceType.InteractiveSearch) if (movieMatchType == MovieMatchType.Id && releaseSource != ReleaseSourceType.InteractiveSearch)
{ {
trackedDownload.Warn("Found matching movie via grab history, but release was matched to movie by ID. Manual Import required."); trackedDownload.Warn("Found matching movie via grab history, but release was matched to movie by ID. Manual Import required.");
SendManualInteractionRequiredNotification(trackedDownload); SetStateToImportBlocked(trackedDownload);
return; return;
} }
@ -128,7 +128,7 @@ public void Import(TrackedDownload trackedDownload)
if (trackedDownload.RemoteMovie?.Movie == null) if (trackedDownload.RemoteMovie?.Movie == null)
{ {
trackedDownload.Warn("Unable to parse download, automatic import is not possible."); trackedDownload.Warn("Unable to parse download, automatic import is not possible.");
SendManualInteractionRequiredNotification(trackedDownload); SetStateToImportBlocked(trackedDownload);
return; return;
} }
@ -186,7 +186,7 @@ public void Import(TrackedDownload trackedDownload)
if (statusMessages.Any()) if (statusMessages.Any())
{ {
trackedDownload.Warn(statusMessages.ToArray()); trackedDownload.Warn(statusMessages.ToArray());
SendManualInteractionRequiredNotification(trackedDownload); SetStateToImportBlocked(trackedDownload);
} }
} }
@ -245,8 +245,10 @@ public bool VerifyImport(TrackedDownload trackedDownload, List<ImportResult> imp
return false; return false;
} }
private void SendManualInteractionRequiredNotification(TrackedDownload trackedDownload) private void SetStateToImportBlocked(TrackedDownload trackedDownload)
{ {
trackedDownload.State = TrackedDownloadState.ImportBlocked;
if (!trackedDownload.HasNotifiedManualInteractionRequired) if (!trackedDownload.HasNotifiedManualInteractionRequired)
{ {
var grabbedHistories = _historyService.FindByDownloadId(trackedDownload.DownloadItem.DownloadId).Where(h => h.EventType == MovieHistoryEventType.Grabbed).ToList(); var grabbedHistories = _historyService.FindByDownloadId(trackedDownload.DownloadItem.DownloadId).Where(h => h.EventType == MovieHistoryEventType.Grabbed).ToList();

View File

@ -40,6 +40,7 @@ public void Warn(params TrackedDownloadStatusMessage[] statusMessages)
public enum TrackedDownloadState public enum TrackedDownloadState
{ {
Downloading, Downloading,
ImportBlocked,
ImportPending, ImportPending,
Importing, Importing,
Imported, Imported,

View File

@ -1705,6 +1705,7 @@
"UiSettingsLoadError": "Unable to load UI settings", "UiSettingsLoadError": "Unable to load UI settings",
"UiSettingsSummary": "Calendar, date and color impaired options", "UiSettingsSummary": "Calendar, date and color impaired options",
"Umask": "Umask", "Umask": "Umask",
"UnableToImportAutomatically": "Unable to Import Automatically",
"UnableToLoadAltTitle": "Unable to load alternative titles.", "UnableToLoadAltTitle": "Unable to load alternative titles.",
"UnableToLoadCollections": "Unable to load collections", "UnableToLoadCollections": "Unable to load collections",
"UnableToLoadManualImportItems": "Unable to load manual import items", "UnableToLoadManualImportItems": "Unable to load manual import items",