Can be used to quickly and conveniently get a list of release profiles (and their Trash IDs) so you know what to add in your YAML config under `release_profiles`.pull/63/head
parent
d598537003
commit
305ae296ab
@ -0,0 +1,6 @@
|
||||
namespace TrashLib.Sonarr;
|
||||
|
||||
public interface IReleaseProfileLister
|
||||
{
|
||||
void ListReleaseProfiles();
|
||||
}
|
@ -0,0 +1,32 @@
|
||||
using CliFx.Infrastructure;
|
||||
using JetBrains.Annotations;
|
||||
using TrashLib.Sonarr.ReleaseProfile.Guide;
|
||||
|
||||
namespace TrashLib.Sonarr;
|
||||
|
||||
[UsedImplicitly]
|
||||
public class ReleaseProfileLister : IReleaseProfileLister
|
||||
{
|
||||
private readonly IConsole _console;
|
||||
private readonly ISonarrGuideService _guide;
|
||||
|
||||
public ReleaseProfileLister(IConsole console, ISonarrGuideService guide)
|
||||
{
|
||||
_console = console;
|
||||
_guide = guide;
|
||||
}
|
||||
|
||||
public void ListReleaseProfiles()
|
||||
{
|
||||
_console.Output.WriteLine("\nList of Release Profiles in the TRaSH Guides:\n");
|
||||
|
||||
var profilesFromGuide = _guide.GetReleaseProfileData();
|
||||
foreach (var profile in profilesFromGuide)
|
||||
{
|
||||
_console.Output.WriteLine($" - {profile.TrashId} # {profile.Name}");
|
||||
}
|
||||
|
||||
_console.Output.WriteLine(
|
||||
"\nThe above Release Profiles are in YAML format and ready to be copied & pasted under the `trash_ids:` property.");
|
||||
}
|
||||
}
|
Loading…
Reference in new issue