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
764 B
29 lines
764 B
using Flurl.Http;
|
|
using Recyclarr.Config.Models;
|
|
using Recyclarr.ServarrApi.Http;
|
|
|
|
namespace Recyclarr.ServarrApi.Tag;
|
|
|
|
public class SonarrTagApiService : ISonarrTagApiService
|
|
{
|
|
private readonly IServiceRequestBuilder _service;
|
|
|
|
public SonarrTagApiService(IServiceRequestBuilder service)
|
|
{
|
|
_service = service;
|
|
}
|
|
|
|
public async Task<IList<SonarrTag>> GetTags(IServiceConfiguration config)
|
|
{
|
|
return await _service.Request(config, "tag")
|
|
.GetJsonAsync<List<SonarrTag>>();
|
|
}
|
|
|
|
public async Task<SonarrTag> CreateTag(IServiceConfiguration config, string tag)
|
|
{
|
|
return await _service.Request(config, "tag")
|
|
.PostJsonAsync(new {label = tag})
|
|
.ReceiveJson<SonarrTag>();
|
|
}
|
|
}
|