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.
25 lines
594 B
25 lines
594 B
using Recyclarr.Config.Models;
|
|
using Recyclarr.ServarrApi.Tag;
|
|
|
|
namespace Recyclarr.Cli.Pipelines.Tags.PipelinePhases;
|
|
|
|
public class TagApiFetchPhase
|
|
{
|
|
private readonly ISonarrTagApiService _api;
|
|
private readonly ServiceTagCache _cache;
|
|
|
|
public TagApiFetchPhase(ISonarrTagApiService api, ServiceTagCache cache)
|
|
{
|
|
_api = api;
|
|
_cache = cache;
|
|
}
|
|
|
|
public async Task<IList<SonarrTag>> Execute(IServiceConfiguration config)
|
|
{
|
|
var tags = await _api.GetTags(config);
|
|
_cache.Clear();
|
|
_cache.AddTags(tags);
|
|
return tags;
|
|
}
|
|
}
|