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.
recyclarr/src/Recyclarr.ServarrApi/Tag/SonarrTagApiService.cs

22 lines
643 B

using Flurl.Http;
using Recyclarr.Config.Models;
using Recyclarr.ServarrApi.Http.Servarr;
namespace Recyclarr.ServarrApi.Tag;
public class SonarrTagApiService(IServarrRequestBuilder service) : ISonarrTagApiService
{
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>();
}
}