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.Compatibility/ServiceCapabilityFetcher.cs

22 lines
541 B

using Recyclarr.Config.Models;
namespace Recyclarr.Compatibility;
public abstract class ServiceCapabilityFetcher<T> where T : class
{
private readonly IServiceInformation _info;
protected ServiceCapabilityFetcher(IServiceInformation info)
{
_info = info;
}
public async Task<T> GetCapabilities(IServiceConfiguration config)
{
var version = await _info.GetVersion(config);
return BuildCapabilitiesObject(version);
}
protected abstract T BuildCapabilitiesObject(Version version);
}