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.
40 lines
1.1 KiB
40 lines
1.1 KiB
using CliFx.Attributes;
|
|
using JetBrains.Annotations;
|
|
using Recyclarr.Command.Initialization;
|
|
using Recyclarr.Command.Services;
|
|
|
|
namespace Recyclarr.Command;
|
|
|
|
[Command("radarr", Description = "Perform operations on a Radarr instance")]
|
|
[UsedImplicitly]
|
|
internal class RadarrCommand : ServiceCommand, IRadarrCommand
|
|
{
|
|
private readonly Lazy<RadarrService> _service;
|
|
private readonly string? _cacheStoragePath;
|
|
|
|
public override string Name => "Radarr";
|
|
|
|
public sealed override string CacheStoragePath
|
|
{
|
|
get => _cacheStoragePath ?? _service.Value.DefaultCacheStoragePath;
|
|
protected init => _cacheStoragePath = value;
|
|
}
|
|
|
|
public RadarrCommand(
|
|
IServiceInitializationAndCleanup init,
|
|
Lazy<RadarrService> service)
|
|
: base(init)
|
|
{
|
|
_service = service;
|
|
}
|
|
|
|
protected override async Task Process()
|
|
{
|
|
await _service.Value.Execute(this);
|
|
}
|
|
|
|
[CommandOption("list-custom-formats", Description =
|
|
"List available custom formats from the guide in YAML format.")]
|
|
public bool ListCustomFormats { get; [UsedImplicitly] set; }
|
|
}
|