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.
29 lines
725 B
29 lines
725 B
using Flurl.Http;
|
|
using Recyclarr.TrashLib.Http;
|
|
using Recyclarr.TrashLib.Services.Sonarr.Api.Objects;
|
|
|
|
namespace Recyclarr.TrashLib.Services.Sonarr.Api;
|
|
|
|
public class SonarrTagApiService : ISonarrTagApiService
|
|
{
|
|
private readonly IServiceRequestBuilder _service;
|
|
|
|
public SonarrTagApiService(IServiceRequestBuilder service)
|
|
{
|
|
_service = service;
|
|
}
|
|
|
|
public async Task<IList<SonarrTag>> GetTags()
|
|
{
|
|
return await _service.Request("tag")
|
|
.GetJsonAsync<List<SonarrTag>>();
|
|
}
|
|
|
|
public async Task<SonarrTag> CreateTag(string tag)
|
|
{
|
|
return await _service.Request("tag")
|
|
.PostJsonAsync(new {label = tag})
|
|
.ReceiveJson<SonarrTag>();
|
|
}
|
|
}
|