feat(sonarr): New --list-qualities argument

For listing quality definition types in the guide.
pull/113/head
Robert Dailey 2 years ago
parent e802c48e70
commit 37ad6fed55

@ -10,7 +10,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added
- Radarr: New `--list-qualities` argument to get a list of quality definition types from the guide.
- New `--list-qualities` argument for `sonarr` and `radarr` subcommands that may be used to get a
list of quality definition types from the guide.
### Changed

@ -26,6 +26,10 @@ public class SonarrCommand : ServiceCommand
"Note that not every release profile has terms that may be filtered.")]
public string? ListTerms { get; [UsedImplicitly] set; } = "empty";
[CommandOption("list-qualities", Description =
"List available quality definition types from the guide.")]
public bool ListQualities { get; [UsedImplicitly] set; }
public override string Name => "Sonarr";
public override async Task Process(IServiceLocatorProxy container)
@ -44,6 +48,12 @@ public class SonarrCommand : ServiceCommand
return;
}
if (ListQualities)
{
lister.ListQualities();
return;
}
if (ListTerms != "empty")
{
if (!string.IsNullOrEmpty(ListTerms))

@ -4,4 +4,5 @@ public interface ISonarrGuideDataLister
{
void ListReleaseProfiles();
void ListTerms(string releaseProfileId);
void ListQualities();
}

@ -1,6 +1,7 @@
using System.Text;
using CliFx.Infrastructure;
using JetBrains.Annotations;
using MoreLinq;
using Serilog;
using TrashLib.Services.Sonarr.ReleaseProfile;
using TrashLib.Services.Sonarr.ReleaseProfile.Guide;
@ -86,4 +87,17 @@ public class SonarrGuideDataLister : ISonarrGuideDataLister
_console.Output.WriteLine();
}
public void ListQualities()
{
_console.Output.WriteLine("\nList of Quality Definition types in the TRaSH Guides:\n");
_guide.GetQualities()
.Select(x => x.Type)
.ForEach(x => _console.Output.WriteLine($" - {x}"));
_console.Output.WriteLine(
"\nThe above quality definition types can be used with the `quality_definition:` property in your " +
"recyclarr.yml file.");
}
}

Loading…
Cancel
Save