mirror of
https://github.com/Radarr/Radarr.git
synced 2024-10-05 15:47:20 +02:00
Fixed: Ensure first history item when marked as failed is the selected item
(cherry picked from commit cf48bf304122bacc597de1d4d4429065d2358fa8) Fixes #8086 Closes #8369
This commit is contained in:
parent
d32582fa7c
commit
c6bb5024bc
@ -38,12 +38,23 @@ public void MarkAsFailed(int historyId)
|
|||||||
if (downloadId.IsNullOrWhiteSpace())
|
if (downloadId.IsNullOrWhiteSpace())
|
||||||
{
|
{
|
||||||
PublishDownloadFailedEvent(new List<MovieHistory> { history }, "Manually marked as failed");
|
PublishDownloadFailedEvent(new List<MovieHistory> { history }, "Manually marked as failed");
|
||||||
|
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
|
var grabbedHistory = new List<MovieHistory>();
|
||||||
|
|
||||||
|
// If the history item is a grabbed item (it should be, at least from the UI) add it as the first history item
|
||||||
|
if (history.EventType == MovieHistoryEventType.Grabbed)
|
||||||
{
|
{
|
||||||
var grabbedHistory = _historyService.Find(downloadId, MovieHistoryEventType.Grabbed).ToList();
|
grabbedHistory.Add(history);
|
||||||
PublishDownloadFailedEvent(grabbedHistory, "Manually marked as failed");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Add any other history items for the download ID then filter out any duplicate history items.
|
||||||
|
grabbedHistory.AddRange(_historyService.Find(downloadId, MovieHistoryEventType.Grabbed));
|
||||||
|
grabbedHistory = grabbedHistory.DistinctBy(h => h.Id).ToList();
|
||||||
|
|
||||||
|
PublishDownloadFailedEvent(grabbedHistory, "Manually marked as failed");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void MarkAsFailed(string downloadId)
|
public void MarkAsFailed(string downloadId)
|
||||||
|
Loading…
Reference in New Issue
Block a user