diff --git a/NzbDrone.Core/NzbDrone.Core.csproj b/NzbDrone.Core/NzbDrone.Core.csproj index 02e4be14d..3b73de5e5 100644 --- a/NzbDrone.Core/NzbDrone.Core.csproj +++ b/NzbDrone.Core/NzbDrone.Core.csproj @@ -177,6 +177,9 @@ ..\packages\SignalR.Hosting.AspNet.0.4.0.0\lib\net40\SignalR.Hosting.AspNet.dll + + ..\packages\SignalR.Ninject.0.4\lib\net40\SignalR.Ninject.dll + diff --git a/NzbDrone.Core/Providers/DiskScanProvider.cs b/NzbDrone.Core/Providers/DiskScanProvider.cs index 1ef1677d8..9720171c8 100644 --- a/NzbDrone.Core/Providers/DiskScanProvider.cs +++ b/NzbDrone.Core/Providers/DiskScanProvider.cs @@ -20,11 +20,13 @@ namespace NzbDrone.Core.Providers private readonly SeriesProvider _seriesProvider; private readonly ExternalNotificationProvider _externalNotificationProvider; private readonly DownloadProvider _downloadProvider; + private readonly SignalRProvider _signalRProvider; [Inject] public DiskScanProvider(DiskProvider diskProvider, EpisodeProvider episodeProvider, SeriesProvider seriesProvider, MediaFileProvider mediaFileProvider, - ExternalNotificationProvider externalNotificationProvider, DownloadProvider downloadProvider) + ExternalNotificationProvider externalNotificationProvider, DownloadProvider downloadProvider, + SignalRProvider signalRProvider) { _diskProvider = diskProvider; _episodeProvider = episodeProvider; @@ -32,6 +34,7 @@ namespace NzbDrone.Core.Providers _mediaFileProvider = mediaFileProvider; _externalNotificationProvider = externalNotificationProvider; _downloadProvider = downloadProvider; + _signalRProvider = signalRProvider; } public DiskScanProvider() @@ -197,6 +200,9 @@ namespace NzbDrone.Core.Providers if (newDownload) { _externalNotificationProvider.OnDownload(message, series); + + foreach(var episode in episodes) + _signalRProvider.UpdateEpisodeStatus(episode.EpisodeId, EpisodeStatusType.Ready); } else { diff --git a/NzbDrone.Core/Providers/SignalRProvider.cs b/NzbDrone.Core/Providers/SignalRProvider.cs index ee96d33c6..628646de4 100644 --- a/NzbDrone.Core/Providers/SignalRProvider.cs +++ b/NzbDrone.Core/Providers/SignalRProvider.cs @@ -13,18 +13,18 @@ namespace NzbDrone.Core.Providers { public class SignalRProvider : Hub { - private static readonly Logger Logger = LogManager.GetCurrentClassLogger(); + 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); + logger.Trace("Sending Status update to client. EpisodeId: {0}, Status: {1}", episodeId, episodeStatus); GetClients().updatedStatus(episodeId, episodeStatus.ToString()); } private static dynamic GetClients() { - IConnectionManager connectionManager = AspNetHost.DependencyResolver.Resolve(); + var connectionManager = AspNetHost.DependencyResolver.Resolve(); return connectionManager.GetClients(); } } diff --git a/NzbDrone.Core/packages.config b/NzbDrone.Core/packages.config index 2039b67b7..bfcb3844f 100644 --- a/NzbDrone.Core/packages.config +++ b/NzbDrone.Core/packages.config @@ -10,6 +10,7 @@ + diff --git a/NzbDrone.Web/Views/Upcoming/UpcomingEpisode.cshtml b/NzbDrone.Web/Views/Upcoming/UpcomingEpisode.cshtml index de7b544c0..806dc18d3 100644 --- a/NzbDrone.Web/Views/Upcoming/UpcomingEpisode.cshtml +++ b/NzbDrone.Web/Views/Upcoming/UpcomingEpisode.cshtml @@ -7,7 +7,7 @@ Layout = null; } - + @Html.ActionLink(Model.SeriesTitle, "Details", "Series", new { seriesId = Model.SeriesId }, null) @Model.EpisodeNumbering @Model.Title @@ -35,7 +35,7 @@ @*Commands Column*@ - @Model.Status + @Model.Status @Ajax.ImageActionLink("../../Content/Images/Search.png", new { Alt = "Search", Title = "Search for episode", @class = "gridImage" }, "Search", "Episode", new { episodeId = Model.EpisodeId }, null, null) diff --git a/packages/SignalR.Ninject.0.4/SignalR.Ninject.0.4.nupkg b/packages/SignalR.Ninject.0.4/SignalR.Ninject.0.4.nupkg new file mode 100644 index 000000000..280d3431a Binary files /dev/null and b/packages/SignalR.Ninject.0.4/SignalR.Ninject.0.4.nupkg differ diff --git a/packages/SignalR.Ninject.0.4/lib/net40/SignalR.Ninject.dll b/packages/SignalR.Ninject.0.4/lib/net40/SignalR.Ninject.dll new file mode 100644 index 000000000..6deeb4a68 Binary files /dev/null and b/packages/SignalR.Ninject.0.4/lib/net40/SignalR.Ninject.dll differ