29 lines
765 B
C#
29 lines
765 B
C#
using OF_DL.Services;
|
|
using Spectre.Console;
|
|
|
|
namespace OF_DL.CLI;
|
|
|
|
/// <summary>
|
|
/// Implementation of IProgressReporter that uses Spectre.Console's ProgressTask for CLI output.
|
|
/// </summary>
|
|
public class SpectreProgressReporter : IProgressReporter
|
|
{
|
|
private readonly ProgressTask _task;
|
|
|
|
public SpectreProgressReporter(ProgressTask task)
|
|
{
|
|
_task = task ?? throw new ArgumentNullException(nameof(task));
|
|
}
|
|
|
|
public void ReportProgress(long increment)
|
|
{
|
|
_task.Increment(increment);
|
|
}
|
|
|
|
public void ReportStatus(string message)
|
|
{
|
|
// Optionally update task description or handle status messages
|
|
// For now, we'll leave this empty as the task description is set when creating the progress bar
|
|
}
|
|
}
|