* fix formatting rules * reformat ersatztv * reformat ersatztv.application * reformat ersatztv.core * refactor ersatztv.core.tests * reformat ersatztv.ffmpeg * reformat ersatztv.ffmpeg.tests * reformat ersatztv.infrastructure * cleanup infra mysql * cleanup infra sqlite * cleanup infra tests * cleanup ersatztv.scanner * cleanup ersatztv.scanner.tests * sln cleanup * update dependencies
16 lines
546 B
C#
16 lines
546 B
C#
using System.Collections.Concurrent;
|
|
using ErsatzTV.Core.Interfaces.Troubleshooting;
|
|
|
|
namespace ErsatzTV.Core.Troubleshooting;
|
|
|
|
public class TroubleshootingNotifier : ITroubleshootingNotifier
|
|
{
|
|
private readonly ConcurrentDictionary<Guid, bool> _failedSessions = new();
|
|
|
|
public bool IsFailed(Guid sessionId) => _failedSessions.TryGetValue(sessionId, out _);
|
|
|
|
public void NotifyFailed(Guid sessionId) => _failedSessions[sessionId] = true;
|
|
|
|
public void RemoveSession(Guid sessionId) => _failedSessions.TryRemove(sessionId, out _);
|
|
}
|