mirror of
https://github.com/Radarr/Radarr.git
synced 2024-09-11 20:12:41 +02:00
Fixed: Mark as Failed errors (#5939)
Originally by Markus McDowall (cherry picked from commit 12fafb24578d39df2eabd2331558b2da961fe8b6) Co-Authored-By: Mark McDowall <markus101@users.noreply.github.com> Fixes: #5907 Fixes: #5938
This commit is contained in:
parent
90289de22c
commit
a9792973ee
@ -232,11 +232,9 @@ export const actionHandlers = handleThunks({
|
||||
}));
|
||||
|
||||
const promise = createAjaxRequest({
|
||||
url: '/history/failed',
|
||||
url: `/history/failed/${id}`,
|
||||
method: 'POST',
|
||||
data: {
|
||||
id
|
||||
}
|
||||
dataType: 'json'
|
||||
}).request;
|
||||
|
||||
promise.done(() => {
|
||||
|
@ -77,11 +77,8 @@ export const actionHandlers = handleThunks({
|
||||
} = payload;
|
||||
|
||||
const promise = createAjaxRequest({
|
||||
url: '/history/failed',
|
||||
method: 'POST',
|
||||
data: {
|
||||
id: historyId
|
||||
}
|
||||
url: `/history/failed/${historyId}`,
|
||||
method: 'POST'
|
||||
}).request;
|
||||
|
||||
promise.done(() => {
|
||||
|
@ -1,7 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Nancy;
|
||||
using NzbDrone.Core.CustomFormats;
|
||||
using NzbDrone.Core.Datastore;
|
||||
using NzbDrone.Core.DecisionEngine.Specifications;
|
||||
@ -39,6 +38,7 @@ public HistoryModule(IHistoryService historyService,
|
||||
Get("/since", x => GetHistorySince());
|
||||
Get("/movie", x => GetMovieHistory());
|
||||
Post("/failed", x => MarkAsFailed());
|
||||
Post(@"/failed/(?<id>[\d]{1,10})", x => MarkAsFailed((int)x.Id));
|
||||
}
|
||||
|
||||
protected HistoryResource MapToResource(MovieHistory model, bool includeMovie)
|
||||
@ -130,10 +130,18 @@ private List<HistoryResource> GetMovieHistory()
|
||||
return _historyService.GetByMovieId(movieId, eventType).Select(h => MapToResource(h, includeMovie)).ToList();
|
||||
}
|
||||
|
||||
// v4 TODO: Getting the ID from the form is atypical, consider removing.
|
||||
private object MarkAsFailed()
|
||||
{
|
||||
var id = (int)Request.Form.Id;
|
||||
|
||||
return MarkAsFailed(id);
|
||||
}
|
||||
|
||||
private object MarkAsFailed(int id)
|
||||
{
|
||||
_failedDownloadService.MarkAsFailed(id);
|
||||
|
||||
return new object();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user