1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-11-05 10:32:35 +01:00
Radarr/NzbDrone.Core/Providers/SignalRProvider.cs
2012-02-18 12:42:13 -08:00

32 lines
931 B
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NLog;
using NzbDrone.Core.Model;
using SignalR;
using SignalR.Hosting.AspNet;
using SignalR.Hubs;
using SignalR.Infrastructure;
namespace NzbDrone.Core.Providers
{
public class SignalRProvider : Hub
{
private static readonly Logger logger = LogManager.GetCurrentClassLogger();
public virtual void UpdateEpisodeStatus(int episodeId, EpisodeStatusType episodeStatus)
{
logger.Trace("Sending Status update to client. EpisodeId: {0}, Status: {1}", episodeId, episodeStatus);
GetClients().updatedStatus(episodeId, episodeStatus.ToString());
}
private dynamic GetClients()
{
var connectionManager = AspNetHost.DependencyResolver.Resolve<IConnectionManager>();
return connectionManager.GetClients<SignalRProvider>();
}
}
}