diff --git a/NzbDrone.Core/Providers/DiskScanProvider.cs b/NzbDrone.Core/Providers/DiskScanProvider.cs index 9720171c8..fc024f8ea 100644 --- a/NzbDrone.Core/Providers/DiskScanProvider.cs +++ b/NzbDrone.Core/Providers/DiskScanProvider.cs @@ -202,7 +202,7 @@ namespace NzbDrone.Core.Providers _externalNotificationProvider.OnDownload(message, series); foreach(var episode in episodes) - _signalRProvider.UpdateEpisodeStatus(episode.EpisodeId, EpisodeStatusType.Ready); + _signalRProvider.UpdateEpisodeStatus(episode.EpisodeId, EpisodeStatusType.Ready, parseResult.Quality); } else { diff --git a/NzbDrone.Core/Providers/DownloadProvider.cs b/NzbDrone.Core/Providers/DownloadProvider.cs index 426288867..f9473c0bc 100644 --- a/NzbDrone.Core/Providers/DownloadProvider.cs +++ b/NzbDrone.Core/Providers/DownloadProvider.cs @@ -67,7 +67,7 @@ namespace NzbDrone.Core.Providers _historyProvider.Add(history); _episodeProvider.MarkEpisodeAsFetched(episode.EpisodeId); - _signalRProvider.UpdateEpisodeStatus(episode.EpisodeId, EpisodeStatusType.Downloading); + _signalRProvider.UpdateEpisodeStatus(episode.EpisodeId, EpisodeStatusType.Downloading, null); } _externalNotificationProvider.OnGrab(downloadTitle); diff --git a/NzbDrone.Core/Providers/SignalRProvider.cs b/NzbDrone.Core/Providers/SignalRProvider.cs index aac95512a..b815d1466 100644 --- a/NzbDrone.Core/Providers/SignalRProvider.cs +++ b/NzbDrone.Core/Providers/SignalRProvider.cs @@ -4,6 +4,7 @@ using System.Linq; using System.Text; using NLog; using NzbDrone.Core.Model; +using NzbDrone.Core.Repository.Quality; using SignalR; using SignalR.Hosting.AspNet; using SignalR.Hubs; @@ -15,11 +16,25 @@ namespace NzbDrone.Core.Providers { private static readonly Logger logger = LogManager.GetCurrentClassLogger(); - public virtual void UpdateEpisodeStatus(int episodeId, EpisodeStatusType episodeStatus) + public virtual void UpdateEpisodeStatus(int episodeId, EpisodeStatusType episodeStatus, Quality quality) { - logger.Trace("Sending Status update to client. EpisodeId: {0}, Status: {1}", episodeId, episodeStatus); + try + { + logger.Trace("Sending Status update to client. EpisodeId: {0}, Status: {1}", episodeId, episodeStatus); - GetClients().updatedStatus(episodeId, episodeStatus.ToString()); + GetClients().updatedStatus(new + { + EpisodeId = episodeId, + EpisodeStatus = episodeStatus.ToString(), + Quality = (quality == null ? String.Empty : quality.QualityType.ToString()) + }); + var test = 0; + } + catch (Exception ex) + { + logger.Trace("Error"); + throw; + } } private dynamic GetClients() diff --git a/NzbDrone.Web/Content/Images/Missing.png b/NzbDrone.Web/Content/Images/Missing.png index 15c3101d0..2bbc78831 100644 Binary files a/NzbDrone.Web/Content/Images/Missing.png and b/NzbDrone.Web/Content/Images/Missing.png differ diff --git a/NzbDrone.Web/Scripts/NzbDrone/grid.js b/NzbDrone.Web/Scripts/NzbDrone/grid.js index af1219627..e2fc1f040 100644 --- a/NzbDrone.Web/Scripts/NzbDrone/grid.js +++ b/NzbDrone.Web/Scripts/NzbDrone/grid.js @@ -63,9 +63,9 @@ $(function () { var signalRProvider = $.connection.signalRProvider; // Declare a function on the chat hub so the server can invoke it - signalRProvider.updatedStatus = function (episodeId, episodeStatus) { - var imageSrc = '../../Content/Images/' + episodeStatus + '.png'; - var row = $('tr.episodeId_' + episodeId); + signalRProvider.updatedStatus = function (data) { + var imageSrc = '../../Content/Images/' + data.EpisodeStatus + '.png'; + var row = $('tr.episodeId_' + data.EpisodeId); if (row.length == 0) return; @@ -75,13 +75,20 @@ $(function () { if (statusImage.length == 0) return; - statusImage.attr('alt', episodeStatus); - statusImage.attr('title', episodeStatus); + statusImage.attr('alt', data.EpisodeStatus); + statusImage.attr('title', data.EpisodeStatus); statusImage.attr('src', imageSrc); - if (episodeStatus != "Missing") { + if (data.EpisodeStatus != "Missing") { statusImage.parent('td').removeClass('episodeMissing'); } + + if (data.Quality != null) { + var qualityColumn = $(row).find('.episodeQuality'); + + if (qualityColumn) + qualityColumn.text(data.Quality); + } }; // Start the connection diff --git a/NzbDrone.Web/Views/Series/Episode.cshtml b/NzbDrone.Web/Views/Series/Episode.cshtml index e9b5c9e32..56c4575ac 100644 --- a/NzbDrone.Web/Views/Series/Episode.cshtml +++ b/NzbDrone.Web/Views/Series/Episode.cshtml @@ -6,7 +6,7 @@