mirror of
https://github.com/Readarr/Readarr.git
synced 2026-04-23 22:25:09 -04:00
Change API Version from V3 to V1
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
using System.Collections.Generic;
|
||||
using Nancy;
|
||||
using NzbDrone.Core.Music;
|
||||
using Lidarr.Http;
|
||||
using Lidarr.Http.Extensions;
|
||||
|
||||
namespace Lidarr.Api.V1.Artist
|
||||
{
|
||||
public class ArtistImportModule : LidarrRestModule<ArtistResource>
|
||||
{
|
||||
private readonly IAddArtistService _addArtistService;
|
||||
|
||||
public ArtistImportModule(IAddArtistService addArtistService)
|
||||
: base("/artist/import")
|
||||
{
|
||||
_addArtistService = addArtistService;
|
||||
Post["/"] = x => Import();
|
||||
}
|
||||
|
||||
|
||||
private Response Import()
|
||||
{
|
||||
var resource = Request.Body.FromJson<List<ArtistResource>>();
|
||||
var newArtist = resource.ToModel();
|
||||
|
||||
return _addArtistService.AddArtists(newArtist).ToResource().AsResponse();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user