using ErsatzTV.Core.Interfaces.Troubleshooting;
using ErsatzTV.Core.Notifications;

namespace ErsatzTV.Application.Troubleshooting;

public class RecordTroubleshootingPlaybackStatusHandler(ITroubleshootingPlaybackStatusStore statusStore)
    : INotificationHandler<PlaybackTroubleshootingCompletedNotification>
{
    public Task Handle(PlaybackTroubleshootingCompletedNotification notification, CancellationToken cancellationToken)
    {
        statusStore.RecordCompletion(notification.ExitCode, notification.MaybeSpeed);
        return Task.CompletedTask;
    }
}
