Fixed: Mark as Failed errors
This commit is contained in:
parent
795bc91d25
commit
12fafb2457
|
@ -86,11 +86,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(() => {
|
||||
|
|
|
@ -244,11 +244,9 @@ export const actionHandlers = handleThunks({
|
|||
}));
|
||||
|
||||
const promise = createAjaxRequest({
|
||||
url: '/history/failed',
|
||||
url: `/history/failed/${id}`,
|
||||
method: 'POST',
|
||||
data: {
|
||||
id
|
||||
}
|
||||
dataType: 'json'
|
||||
}).request;
|
||||
|
||||
promise.done(() => {
|
||||
|
|
|
@ -1,9 +1,7 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Nancy;
|
||||
using NzbDrone.Core.Datastore;
|
||||
using NzbDrone.Core.DecisionEngine;
|
||||
using NzbDrone.Core.DecisionEngine.Specifications;
|
||||
using NzbDrone.Core.Download;
|
||||
using NzbDrone.Core.History;
|
||||
|
@ -33,6 +31,8 @@ namespace Sonarr.Api.V3.History
|
|||
Get("/since", x => GetHistorySince());
|
||||
Get("/series", x => GetSeriesHistory());
|
||||
Post("/failed", x => MarkAsFailed());
|
||||
Post(@"/failed/(?<id>[\d]{1,10})", x => MarkAsFailed((int)x.Id));
|
||||
|
||||
}
|
||||
|
||||
protected HistoryResource MapToResource(EpisodeHistory model, bool includeSeries, bool includeEpisode)
|
||||
|
@ -143,10 +143,18 @@ namespace Sonarr.Api.V3.History
|
|||
return _historyService.GetBySeries(seriesId, eventType).Select(h => MapToResource(h, includeSeries, includeEpisode)).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