mirror of
https://github.com/Radarr/Radarr.git
synced 2024-11-20 01:42:35 +01:00
New: Send 'On Manual Interaction Required' notifications in more cases
(cherry picked from commit c5a724f14eec20acf565ac3a036944191b30cab0) Closes #9722
This commit is contained in:
parent
f704ab1512
commit
e73015010e
@ -94,7 +94,9 @@ public void Check(TrackedDownload trackedDownload)
|
|||||||
|
|
||||||
if (movie == null)
|
if (movie == null)
|
||||||
{
|
{
|
||||||
trackedDownload.Warn("Movie title mismatch, Manual Import required.");
|
trackedDownload.Warn("Movie title mismatch, automatic import is not possible. Manual Import required.");
|
||||||
|
SendManualInteractionRequiredNotification(trackedDownload);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -105,16 +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);
|
||||||
if (!trackedDownload.HasNotifiedManualInteractionRequired)
|
|
||||||
{
|
|
||||||
trackedDownload.HasNotifiedManualInteractionRequired = true;
|
|
||||||
|
|
||||||
var releaseInfo = new GrabbedReleaseInfo(grabbedHistories);
|
|
||||||
var manualInteractionEvent = new ManualInteractionRequiredEvent(trackedDownload, releaseInfo);
|
|
||||||
|
|
||||||
_eventAggregator.PublishEvent(manualInteractionEvent);
|
|
||||||
}
|
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -132,18 +125,21 @@ public void Import(TrackedDownload trackedDownload)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
trackedDownload.State = TrackedDownloadState.Importing;
|
|
||||||
|
|
||||||
var outputPath = trackedDownload.ImportItem.OutputPath.FullPath;
|
|
||||||
|
|
||||||
if (trackedDownload.RemoteMovie?.Movie == null)
|
if (trackedDownload.RemoteMovie?.Movie == null)
|
||||||
{
|
{
|
||||||
trackedDownload.State = TrackedDownloadState.ImportPending;
|
trackedDownload.Warn("Unable to parse download, automatic import is not possible.");
|
||||||
trackedDownload.Warn("Unknown Movie", outputPath);
|
SendManualInteractionRequiredNotification(trackedDownload);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var importResults = _downloadedMovieImportService.ProcessPath(outputPath, ImportMode.Auto, trackedDownload.RemoteMovie.Movie, trackedDownload.ImportItem);
|
trackedDownload.State = TrackedDownloadState.Importing;
|
||||||
|
|
||||||
|
var outputPath = trackedDownload.ImportItem.OutputPath.FullPath;
|
||||||
|
var importResults = _downloadedMovieImportService.ProcessPath(outputPath,
|
||||||
|
ImportMode.Auto,
|
||||||
|
trackedDownload.RemoteMovie.Movie,
|
||||||
|
trackedDownload.ImportItem);
|
||||||
|
|
||||||
if (VerifyImport(trackedDownload, importResults))
|
if (VerifyImport(trackedDownload, importResults))
|
||||||
{
|
{
|
||||||
@ -190,6 +186,7 @@ public void Import(TrackedDownload trackedDownload)
|
|||||||
if (statusMessages.Any())
|
if (statusMessages.Any())
|
||||||
{
|
{
|
||||||
trackedDownload.Warn(statusMessages.ToArray());
|
trackedDownload.Warn(statusMessages.ToArray());
|
||||||
|
SendManualInteractionRequiredNotification(trackedDownload);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -248,6 +245,21 @@ public bool VerifyImport(TrackedDownload trackedDownload, List<ImportResult> imp
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void SendManualInteractionRequiredNotification(TrackedDownload trackedDownload)
|
||||||
|
{
|
||||||
|
if (!trackedDownload.HasNotifiedManualInteractionRequired)
|
||||||
|
{
|
||||||
|
var grabbedHistories = _historyService.FindByDownloadId(trackedDownload.DownloadItem.DownloadId).Where(h => h.EventType == MovieHistoryEventType.Grabbed).ToList();
|
||||||
|
|
||||||
|
trackedDownload.HasNotifiedManualInteractionRequired = true;
|
||||||
|
|
||||||
|
var releaseInfo = grabbedHistories.Count > 0 ? new GrabbedReleaseInfo(grabbedHistories) : null;
|
||||||
|
var manualInteractionEvent = new ManualInteractionRequiredEvent(trackedDownload, releaseInfo);
|
||||||
|
|
||||||
|
_eventAggregator.PublishEvent(manualInteractionEvent);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void SetImportItem(TrackedDownload trackedDownload)
|
private void SetImportItem(TrackedDownload trackedDownload)
|
||||||
{
|
{
|
||||||
trackedDownload.ImportItem = _provideImportItemService.ProvideImportItem(trackedDownload.DownloadItem, trackedDownload.ImportItem);
|
trackedDownload.ImportItem = _provideImportItemService.ProvideImportItem(trackedDownload.DownloadItem, trackedDownload.ImportItem);
|
||||||
|
Loading…
Reference in New Issue
Block a user