mirror of
https://github.com/Radarr/Radarr.git
synced 2026-04-22 22:15:17 -04:00
New: Mass series editor
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Runtime.Remoting.Messaging;
|
||||
using Nancy;
|
||||
using NzbDrone.Api.Extensions;
|
||||
using NzbDrone.Api.Mapping;
|
||||
using NzbDrone.Core.Tv;
|
||||
|
||||
namespace NzbDrone.Api.Series
|
||||
{
|
||||
public class SeriesEditorModule : NzbDroneApiModule
|
||||
{
|
||||
private readonly ISeriesService _seriesService;
|
||||
|
||||
public SeriesEditorModule(ISeriesService seriesService)
|
||||
: base("/series/editor")
|
||||
{
|
||||
_seriesService = seriesService;
|
||||
Put["/"] = series => SaveAll();
|
||||
}
|
||||
|
||||
private Response SaveAll()
|
||||
{
|
||||
//Read from request
|
||||
var series = Request.Body.FromJson<List<SeriesResource>>().InjectTo<List<Core.Tv.Series>>();
|
||||
|
||||
return _seriesService.UpdateSeries(series).InjectTo<List<SeriesResource>>().AsResponse();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user