aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Server.Implementations
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2014-05-09 00:38:12 -0400
committerLuke Pulverenti <luke.pulverenti@gmail.com>2014-05-09 00:38:12 -0400
commit1a323767be3808f8cdd055e8481ca8c1ea0b1582 (patch)
tree92192376a9ed141ccc771017957f3f5a4a1b8ac7 /MediaBrowser.Server.Implementations
parent06a11c27d91193ece901241c51194992075ed8ea (diff)
Do better to make sure hls files are cleaned up
Diffstat (limited to 'MediaBrowser.Server.Implementations')
-rw-r--r--MediaBrowser.Server.Implementations/EntryPoints/Notifications/Notifications.cs21
-rw-r--r--MediaBrowser.Server.Implementations/Localization/Server/server.json7
-rw-r--r--MediaBrowser.Server.Implementations/Notifications/CoreNotificationTypes.cs7
3 files changed, 27 insertions, 8 deletions
diff --git a/MediaBrowser.Server.Implementations/EntryPoints/Notifications/Notifications.cs b/MediaBrowser.Server.Implementations/EntryPoints/Notifications/Notifications.cs
index 7607ec98a3..fdc81db373 100644
--- a/MediaBrowser.Server.Implementations/EntryPoints/Notifications/Notifications.cs
+++ b/MediaBrowser.Server.Implementations/EntryPoints/Notifications/Notifications.cs
@@ -1,4 +1,5 @@
-using MediaBrowser.Common.Events;
+using System.Globalization;
+using MediaBrowser.Common.Events;
using MediaBrowser.Common.Plugins;
using MediaBrowser.Common.ScheduledTasks;
using MediaBrowser.Common.Updates;
@@ -247,10 +248,10 @@ namespace MediaBrowser.Server.Implementations.EntryPoints.Notifications
DisposeLibraryUpdateTimer();
}
- var item = items.FirstOrDefault();
-
- if (item != null)
+ if (items.Count == 1)
{
+ var item = items.First();
+
var notification = new NotificationRequest
{
NotificationType = NotificationType.NewLibraryContent.ToString()
@@ -258,10 +259,16 @@ namespace MediaBrowser.Server.Implementations.EntryPoints.Notifications
notification.Variables["Name"] = item.Name;
- if (items.Count > 1)
+ await SendNotification(notification).ConfigureAwait(false);
+ }
+ else
+ {
+ var notification = new NotificationRequest
{
- notification.Name = items.Count + " new library items.";
- }
+ NotificationType = NotificationType.NewLibraryContentMultiple.ToString()
+ };
+
+ notification.Variables["ItemCount"] = items.Count.ToString(CultureInfo.InvariantCulture);
await SendNotification(notification).ConfigureAwait(false);
}
diff --git a/MediaBrowser.Server.Implementations/Localization/Server/server.json b/MediaBrowser.Server.Implementations/Localization/Server/server.json
index 781a4c5b70..bcd04f4ae3 100644
--- a/MediaBrowser.Server.Implementations/Localization/Server/server.json
+++ b/MediaBrowser.Server.Implementations/Localization/Server/server.json
@@ -568,6 +568,7 @@
"NotificationOptionTaskFailed": "Scheduled task failure",
"NotificationOptionInstallationFailed": "Installation failure",
"NotificationOptionNewLibraryContent": "New content added",
+ "NotificationOptionNewLibraryContentMultiple": "New content added (multiple)",
"SendNotificationHelp": "By default, notifications are delivered to the dashboard inbox. Browse the plugin catalog to install additional notification options.",
"NotificationOptionServerRestartRequired": "Server restart required",
"LabelNotificationEnabled": "Enable this notification",
@@ -716,5 +717,9 @@
"LabelDownloadLanguages": "Download languages:",
"ButtonRegister": "Register",
"LabelSkipIfAudioTrackPresent": "Skip if the default audio track matches the download language",
- "LabelSkipIfAudioTrackPresentHelp": "Uncheck this to ensure all videos have subtitles, regardless of audio language."
+ "LabelSkipIfAudioTrackPresentHelp": "Uncheck this to ensure all videos have subtitles, regardless of audio language.",
+ "HeaderSendMessage": "Send Message",
+ "ButtonSend": "Send",
+ "LabelMessageText": "Message text:",
+ "LabelMessageTitle": "Message title:"
} \ No newline at end of file
diff --git a/MediaBrowser.Server.Implementations/Notifications/CoreNotificationTypes.cs b/MediaBrowser.Server.Implementations/Notifications/CoreNotificationTypes.cs
index f712949d91..012b5ae927 100644
--- a/MediaBrowser.Server.Implementations/Notifications/CoreNotificationTypes.cs
+++ b/MediaBrowser.Server.Implementations/Notifications/CoreNotificationTypes.cs
@@ -92,6 +92,13 @@ namespace MediaBrowser.Server.Implementations.Notifications
new NotificationTypeInfo
{
+ Type = NotificationType.NewLibraryContentMultiple.ToString(),
+ DefaultTitle = "{ItemCount} new items have been added to your media library.",
+ Variables = new List<string>{"ItemCount"}
+ },
+
+ new NotificationTypeInfo
+ {
Type = NotificationType.AudioPlayback.ToString(),
DefaultTitle = "{UserName} is playing {ItemName} on {DeviceName}.",
Variables = new List<string>{"UserName", "ItemName", "DeviceName", "AppName"}