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.
recyclarr/src/Recyclarr.Cli/Pipelines/Tags/PipelinePhases/TagPreviewPhase.cs

32 lines
816 B

using Castle.Core.Internal;
using Recyclarr.Cli.Pipelines.Generic;
using Spectre.Console;
namespace Recyclarr.Cli.Pipelines.Tags.PipelinePhases;
public class TagPreviewPhase(IAnsiConsole console) : IPreviewPipelinePhase<TagPipelineContext>
{
public void Execute(TagPipelineContext context)
{
var tagsToCreate = context.TransactionOutput;
if (tagsToCreate.IsNullOrEmpty())
{
console.WriteLine();
console.MarkupLine("[green]No tags to create[/]");
console.WriteLine();
return;
}
var table = new Table {Border = TableBorder.Simple};
table.AddColumn("[olive]Tags To Create[/]");
foreach (var tag in tagsToCreate)
{
table.AddRow(tag);
}
console.Write(table);
}
}