mirror of
https://github.com/Lidarr/Lidarr
synced 2025-12-06 08:25:54 +01:00
31 lines
882 B
C#
31 lines
882 B
C#
using Nancy;
|
|
using Lidarr.Http.Extensions;
|
|
using NzbDrone.Core.Music;
|
|
|
|
namespace NzbDrone.Api.AlbumPass
|
|
{
|
|
public class AlbumStudioModule : NzbDroneApiModule
|
|
{
|
|
private readonly IAlbumMonitoredService _albumMonitoredService;
|
|
|
|
public AlbumStudioModule(IAlbumMonitoredService albumMonitoredService)
|
|
: base("/albumstudio")
|
|
{
|
|
_albumMonitoredService = albumMonitoredService;
|
|
Post["/"] = artist => UpdateAll();
|
|
}
|
|
|
|
private Response UpdateAll()
|
|
{
|
|
//Read from request
|
|
var request = Request.Body.FromJson<AlbumStudioResource>();
|
|
|
|
foreach (var s in request.Artist)
|
|
{
|
|
_albumMonitoredService.SetAlbumMonitoredStatus(s, request.MonitoringOptions);
|
|
}
|
|
|
|
return "ok".AsResponse(HttpStatusCode.Accepted);
|
|
}
|
|
}
|
|
}
|