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.
34 lines
1.1 KiB
34 lines
1.1 KiB
using Serilog;
|
|
using TrashLib.Repo;
|
|
using TrashLib.Services.CustomFormat.Guide;
|
|
using TrashLib.Services.CustomFormat.Models;
|
|
using TrashLib.Services.QualitySize;
|
|
using TrashLib.Services.QualitySize.Guide;
|
|
|
|
namespace TrashLib.Services.Radarr;
|
|
|
|
public class LocalRepoRadarrGuideService : IRadarrGuideService
|
|
{
|
|
private readonly IRepoPathsFactory _pathsFactory;
|
|
private readonly ICustomFormatLoader _cfLoader;
|
|
private readonly QualitySizeGuideParser<QualitySizeData> _parser;
|
|
|
|
public LocalRepoRadarrGuideService(IRepoPathsFactory pathsFactory, ILogger log, ICustomFormatLoader cfLoader)
|
|
{
|
|
_pathsFactory = pathsFactory;
|
|
_cfLoader = cfLoader;
|
|
_parser = new QualitySizeGuideParser<QualitySizeData>(log);
|
|
}
|
|
|
|
public ICollection<QualitySizeData> GetQualities()
|
|
=> _parser.GetQualities(_pathsFactory.Create().RadarrQualityPaths);
|
|
|
|
public ICollection<CustomFormatData> GetCustomFormatData()
|
|
{
|
|
var paths = _pathsFactory.Create();
|
|
return _cfLoader.LoadAllCustomFormatsAtPaths(
|
|
paths.RadarrCustomFormatPaths,
|
|
paths.RadarrCollectionOfCustomFormats);
|
|
}
|
|
}
|