mirror of
https://github.com/Readarr/Readarr.git
synced 2026-04-19 21:44:30 -04:00
Method, Variable, Class Renames in Readarr.Api
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
using System.Collections.Generic;
|
||||
using Nancy;
|
||||
using NzbDrone.Core.Books;
|
||||
using Readarr.Http;
|
||||
using Readarr.Http.Extensions;
|
||||
|
||||
namespace Readarr.Api.V1.Author
|
||||
{
|
||||
public class AuthorImportModule : ReadarrRestModule<AuthorResource>
|
||||
{
|
||||
private readonly IAddAuthorService _addAuthorService;
|
||||
|
||||
public AuthorImportModule(IAddAuthorService addAuthorService)
|
||||
: base("/author/import")
|
||||
{
|
||||
_addAuthorService = addAuthorService;
|
||||
Post("/", x => Import());
|
||||
}
|
||||
|
||||
private object Import()
|
||||
{
|
||||
var resource = Request.Body.FromJson<List<AuthorResource>>();
|
||||
var newAuthors = resource.ToModel();
|
||||
|
||||
return _addAuthorService.AddAuthors(newAuthors).ToResource();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user