Add a singleton ITroubleshootingPlaybackStatusStore (Core, alongside TroubleshootingNotifier) that records the exit code + speed of the most recent troubleshooting playback session. A new MediatR notification handler writes to it on PlaybackTroubleshootingCompletedNotification, and PrepareTroubleshootingPlaybackHandler resets it when a new session starts (both the channel and media-item lock paths). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
15 lines
567 B
C#
15 lines
567 B
C#
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;
|
|
}
|
|
}
|