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.
29 lines
953 B
29 lines
953 B
using Recyclarr.Cli.Pipelines.Generic;
|
|
using Spectre.Console;
|
|
|
|
namespace Recyclarr.Cli.Pipelines.QualitySize.PipelinePhases;
|
|
|
|
public class QualitySizePreviewPhase(IAnsiConsole console) : IPreviewPipelinePhase<QualitySizePipelineContext>
|
|
{
|
|
public void Execute(QualitySizePipelineContext context)
|
|
{
|
|
var table = new Table();
|
|
|
|
table.Title("Quality Sizes [red](Preview)[/]");
|
|
table.AddColumn("[bold]Quality[/]");
|
|
table.AddColumn("[bold]Min[/]");
|
|
table.AddColumn("[bold]Max[/]");
|
|
table.AddColumn("[bold]Preferred[/]");
|
|
|
|
// Do not check ConfigOutput for null here since the LogPhase checks that for us
|
|
foreach (var q in context.ConfigOutput!.Qualities)
|
|
{
|
|
var quality = $"[dodgerblue1]{q.Quality}[/]";
|
|
table.AddRow(quality, q.AnnotatedMin, q.AnnotatedMax, q.AnnotatedPreferred);
|
|
}
|
|
|
|
console.WriteLine();
|
|
console.Write(table);
|
|
}
|
|
}
|