From c739b3e132a93a42703c1d768997326d1bbb8f57 Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Sun, 12 Feb 2012 15:37:55 -0800 Subject: [PATCH] Update clients when new episode is imported (ready). --- NzbDrone.Core/NzbDrone.Core.csproj | 3 +++ NzbDrone.Core/Providers/DiskScanProvider.cs | 8 +++++++- NzbDrone.Core/Providers/SignalRProvider.cs | 6 +++--- NzbDrone.Core/packages.config | 1 + .../Views/Upcoming/UpcomingEpisode.cshtml | 4 ++-- .../SignalR.Ninject.0.4.nupkg | Bin 0 -> 5205 bytes .../lib/net40/SignalR.Ninject.dll | Bin 0 -> 5120 bytes 7 files changed, 16 insertions(+), 6 deletions(-) create mode 100644 packages/SignalR.Ninject.0.4/SignalR.Ninject.0.4.nupkg create mode 100644 packages/SignalR.Ninject.0.4/lib/net40/SignalR.Ninject.dll 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 0000000000000000000000000000000000000000..280d3431a3cc44c358dc912b86f679c91301d6a3 GIT binary patch literal 5205 zcmc&&2~-p3zDKWH>+{unU8q#TdkD3 zFYJm771Ze!6_sVwK7+_!)Dfse1=%r%1hUQYCb*%udivh!Iggx~bB6iv-~ap1_xr6{ z{(&fi}u=+`aw1})@!8A7dC(tjFQovtan=0=QcBskL?$I|E4KGyjZcq zC|V3CmGQ+QZwD7AX9pT6;)uC?QG~Zcw4CQS$ARVJ4>++aXde zm&~QpWt>P*$d);YC7_6U!xKw|Y&rEPji5`|905B5q`Nvhd(f$9-r8_@*CuUkoCN$g zi$Xp}Dwc_Pawm>h_{ta+7iG@HneNP_3)vz*50uFrXlvQh2vF|rKwra;5V52DomTQi zn?R1-Nfa%UfE)+fH(YNAf1WdsA;CZk)3=emP1C9P?!uVe$Mi+u|HkU1D(>Y=( z=qQm=+EO_mlnn^-by;MfG=|RsWgpa`yD>N*2)es_aG9PA9>-&jYq$r)WsVDz!C-`Y zvbjzYnUKqoyvmP3$+&oWx`i{D;S3LFW`BP4ch=5l71cOnZ3f$n=x?00PUD9^rkbX2 zu#L@ls&W3fd>`wfuA<=^zxd|JwCQx=-EW~~z01(Y@)IMrZX7f9;lBB!yKe5TXgSa|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zIy zo}_;_<(Kj*^+Iyn{qC!`kzv?n;NWrIsWln6-O%u%AT`il+R=>ih{?>Z=WP zaE*V#9^yc&*c^RDDZCNun~CZx4q$mcr-1Jpx*n2!P|_!nRCrWJPBCLU>SwnhY4!QY zurJCv;i_p1Eqt?lS>_o;^`kOmbLs?g-ZXN?X&+hq$t=Pt$nA{&!M6Gn(BEpFq`CS; z_NMq;JMQPY$+QPMZp~~!TO>Rkv7GqQC@Rcr8u+EQlPK=31^w{ z^FMpHoCqiwbVsx{)iQAmF|8q)wTEWyRGAsu*062atSr9@P1S^aB7!ki%LCh6WXP~Ae=?Lh+*_~J)Pe0U zhaMk06d1 zr2`fE-@K8GmGR%0RVWlr3b%g46hw8QulHTCrXS5Z@xf5i6oV>1^5}wvf*j(H3(RY$;dfMIRt&RpNp&j+8I4!f>Aj zG|@|dOXGqR?B-ICJ&q;?W#T9b%G3Bl$;%q`<82y+$Z4;EUBA_VmaLZfl)jwLn|Q;4aUt$4a0_r6`re!%&*9|4=GzuusLh4mUk z^<&6Fu}DsN2do5uEY!)$M*Jm=MZdlOBU8b78Iz;j8WY7-ECPA#=qNdDaV!<;OQOU| ztvJwL1^<$~U`r%Xd`^GK=`kYidwhuFtDR>hW!};tv#5OgQTiXacuie=(21BM2Py7@ zs`(#iQ~2v6@qJYFHK*`F#~;b=J<{V%e)RtJpqgROU`Ly`?eH#f^*%o}fW~^M_#xtA zprR)=>E7$&S1i!`Hr@rZ18wk!*nAw?zMsdtV|Jh^yZ^NL>xb_9?%&;21KsD0w)vwy Wwrcs%VOFuB)NePn74!dLefl2-lcGBS literal 0 HcmV?d00001 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 0000000000000000000000000000000000000000..6deeb4a68f78012c9e5810a067635990e7057704 GIT binary patch literal 5120 zcmeHLU2Ggz6+ScT#6O9*v2j8RZn(w`GO0cC)&@C&mbJZhVq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