Do better to make sure hls files are cleaned up

This commit is contained in:
Luke Pulverenti
2014-05-09 00:38:12 -04:00
parent 06a11c27d9
commit 1a323767be
19 changed files with 297 additions and 85 deletions

View File

@@ -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);
}

View File

@@ -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:"
}

View File

@@ -90,6 +90,13 @@ namespace MediaBrowser.Server.Implementations.Notifications
Variables = new List<string>{"Name"}
},
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(),