You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
688 B
27 lines
688 B
using System.Collections.Generic;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
using NzbDrone.Core.Tv;
|
|
using Sonarr.Http;
|
|
|
|
namespace Sonarr.Api.V3.Series
|
|
{
|
|
[V3ApiController("series/import")]
|
|
public class SeriesImportController : Controller
|
|
{
|
|
private readonly IAddSeriesService _addSeriesService;
|
|
|
|
public SeriesImportController(IAddSeriesService addSeriesService)
|
|
{
|
|
_addSeriesService = addSeriesService;
|
|
}
|
|
|
|
[HttpPost]
|
|
public object Import([FromBody] List<SeriesResource> resource)
|
|
{
|
|
var newSeries = resource.ToModel();
|
|
|
|
return _addSeriesService.AddSeries(newSeries).ToResource();
|
|
}
|
|
}
|
|
}
|