diff --git a/NzbDrone.Core/Model/Notification/ProgressNotification.cs b/NzbDrone.Core/Model/Notification/ProgressNotification.cs index d9e876eae..05177cea2 100644 --- a/NzbDrone.Core/Model/Notification/ProgressNotification.cs +++ b/NzbDrone.Core/Model/Notification/ProgressNotification.cs @@ -41,7 +41,7 @@ public ProgressNotification(string title) /// The percent complete. public int PercentComplete { - get { return Convert.ToInt32(Convert.ToDouble(ProgressValue)/Convert.ToDouble(ProgressMax)*100); } + get { return Convert.ToInt32(Convert.ToDouble(ProgressValue) / Convert.ToDouble(ProgressMax) * 100); } } /// @@ -56,11 +56,30 @@ public int PercentComplete /// The progress value. public int ProgressValue { get; set; } + private ProgressNotificationStatus _status; + /// /// Gets or sets the status. /// /// The status. - public ProgressNotificationStatus Status { get; set; } + public ProgressNotificationStatus Status + { + get { return _status; } + set + { + if (value != ProgressNotificationStatus.InProgress) + { + CompletedTime = DateTime.Now; + } + _status = value; + } + } + + + /// + /// Gets the completed time. + /// + public DateTime CompletedTime { get; private set; } #region IDisposable Members diff --git a/NzbDrone.Core/Providers/Jobs/NewSeriesUpdate.cs b/NzbDrone.Core/Providers/Jobs/NewSeriesUpdate.cs index 4299c2ffa..e3f850ec1 100644 --- a/NzbDrone.Core/Providers/Jobs/NewSeriesUpdate.cs +++ b/NzbDrone.Core/Providers/Jobs/NewSeriesUpdate.cs @@ -52,8 +52,8 @@ private void ScanSeries(ProgressNotification notification) updatedSeries.Title); _episodeProvider.RefreshEpisodeInfo(updatedSeries.SeriesId); - notification.CurrentStatus = String.Format("Scanning series folder {0}", - updatedSeries.Path); + notification.CurrentStatus = String.Format("Scanning disk for {0} files", + updatedSeries.Title); _mediaFileProvider.Scan(_seriesProvider.GetSeries(updatedSeries.SeriesId)); } diff --git a/NzbDrone.Core/Providers/Jobs/UpdateInfoJob.cs b/NzbDrone.Core/Providers/Jobs/UpdateInfoJob.cs index 2485ca8c2..04a83a00a 100644 --- a/NzbDrone.Core/Providers/Jobs/UpdateInfoJob.cs +++ b/NzbDrone.Core/Providers/Jobs/UpdateInfoJob.cs @@ -44,6 +44,7 @@ public void Start(ProgressNotification notification, int targetId) _seriesProvider.UpdateSeriesInfo(series.SeriesId); notification.CurrentStatus = "Updating episode info for " + series.Title; _episodeProvider.RefreshEpisodeInfo(series.SeriesId); + notification.CurrentStatus = "Update completed for " + series.Title; } } } diff --git a/NzbDrone.Core/Providers/NotificationProvider.cs b/NzbDrone.Core/Providers/NotificationProvider.cs index 924856199..88f933d64 100644 --- a/NzbDrone.Core/Providers/NotificationProvider.cs +++ b/NzbDrone.Core/Providers/NotificationProvider.cs @@ -24,9 +24,17 @@ public virtual List GetProgressNotifications { get { - return - new List( - _progressNotification.Values.Where(p => p.Status == ProgressNotificationStatus.InProgress)); + + var activeNotification = _progressNotification.Values.Where(p => p.Status == ProgressNotificationStatus.InProgress).ToList(); + + if (activeNotification.Count == 0) + { + //Get notifications that were recently done + activeNotification = _progressNotification.Values.Where(p => p.CompletedTime >= DateTime.Now.AddSeconds(-3)).OrderByDescending(c => c.CompletedTime).ToList(); + + } + + return activeNotification.ToList(); } } diff --git a/NzbDrone.Web/Content/notibar.css b/NzbDrone.Web/Content/notibar.css index deeddac47..d5c65537a 100644 --- a/NzbDrone.Web/Content/notibar.css +++ b/NzbDrone.Web/Content/notibar.css @@ -1,9 +1,8 @@ #msgBox { display: none; - height: 40px; + height: 30px; background-color: #272525; - background-image: url(images/spin.gif) no-repeat left middle; opacity: .9; -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=85)"; filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=85); @@ -12,13 +11,10 @@ position: fixed; z-index: 99; bottom: 0; + right: 0; font-size: 20px; color: White; - width: 100% - margin-right: auto; - width: 85%; - margin-left: auto; - min-width: 800px; + text-align: center; } #msgCloseButton { diff --git a/NzbDrone.Web/Scripts/Notification.js b/NzbDrone.Web/Scripts/Notification.js index 48b212e5c..8604b8c27 100644 --- a/NzbDrone.Web/Scripts/Notification.js +++ b/NzbDrone.Web/Scripts/Notification.js @@ -4,7 +4,7 @@ $(function () { refreshNotifications(); var timer = window.setInterval(function () { - speed = 1000; + speed = 500; refreshNotifications(); }, 2000); diff --git a/NzbDrone.Web/Views/Shared/SiteLayout.cshtml b/NzbDrone.Web/Views/Shared/SiteLayout.cshtml index a3a846299..a40680b7f 100644 --- a/NzbDrone.Web/Views/Shared/SiteLayout.cshtml +++ b/NzbDrone.Web/Views/Shared/SiteLayout.cshtml @@ -1,53 +1,48 @@ @using Helpers; - - - - - NZBDrone - @{Html.Telerik().StyleSheetRegistrar().DefaultGroup(group => group.Add("telerik.common.css") + + + + NZBDrone + @{Html.Telerik().StyleSheetRegistrar().DefaultGroup(group => group.Add("telerik.common.css") .Add("telerik.sitefinity.css") .Add("notibar.css")) .Render();} - - - - - - @RenderSection("HeaderContent", required: false) - - -
- - -
- @RenderSection("ActionMenu", required: false) - @RenderSection("MainContent", required: false) - @RenderBody() -
- -
- Scanning Series Folder... -
+ + + + @RenderSection("HeaderContent", required: false) + + +
+ - - - @RenderSection("Scripts", required: false) - - @{Html.Telerik().ScriptRegistrar().Scripts( + +
+ @RenderSection("ActionMenu", required: false) + @RenderSection("MainContent", required: false) + @RenderBody() +
+ +
+
+ Scanning Series Folder... +
+ +@RenderSection("Scripts", required: false) +@{Html.Telerik().ScriptRegistrar().Scripts( c => c.Add("jquery-ui-1.8.8.min.js") .Add("jquery.form.js") .Add("jquery.jgrowl.js")