|
@@ -11,101 +11,81 @@ namespace Emby.Notifications
|
|
|
public class CoreNotificationTypes : INotificationTypeFactory
|
|
public class CoreNotificationTypes : INotificationTypeFactory
|
|
|
{
|
|
{
|
|
|
private readonly ILocalizationManager _localization;
|
|
private readonly ILocalizationManager _localization;
|
|
|
- private readonly IServerApplicationHost _appHost;
|
|
|
|
|
|
|
|
|
|
- public CoreNotificationTypes(ILocalizationManager localization, IServerApplicationHost appHost)
|
|
|
|
|
|
|
+ public CoreNotificationTypes(ILocalizationManager localization)
|
|
|
{
|
|
{
|
|
|
_localization = localization;
|
|
_localization = localization;
|
|
|
- _appHost = appHost;
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public IEnumerable<NotificationTypeInfo> GetNotificationTypes()
|
|
public IEnumerable<NotificationTypeInfo> GetNotificationTypes()
|
|
|
{
|
|
{
|
|
|
- var knownTypes = new List<NotificationTypeInfo>
|
|
|
|
|
|
|
+ var knownTypes = new NotificationTypeInfo[]
|
|
|
{
|
|
{
|
|
|
new NotificationTypeInfo
|
|
new NotificationTypeInfo
|
|
|
{
|
|
{
|
|
|
Type = NotificationType.ApplicationUpdateInstalled.ToString()
|
|
Type = NotificationType.ApplicationUpdateInstalled.ToString()
|
|
|
},
|
|
},
|
|
|
-
|
|
|
|
|
new NotificationTypeInfo
|
|
new NotificationTypeInfo
|
|
|
{
|
|
{
|
|
|
Type = NotificationType.InstallationFailed.ToString()
|
|
Type = NotificationType.InstallationFailed.ToString()
|
|
|
},
|
|
},
|
|
|
-
|
|
|
|
|
new NotificationTypeInfo
|
|
new NotificationTypeInfo
|
|
|
{
|
|
{
|
|
|
Type = NotificationType.PluginInstalled.ToString()
|
|
Type = NotificationType.PluginInstalled.ToString()
|
|
|
},
|
|
},
|
|
|
-
|
|
|
|
|
new NotificationTypeInfo
|
|
new NotificationTypeInfo
|
|
|
{
|
|
{
|
|
|
Type = NotificationType.PluginError.ToString()
|
|
Type = NotificationType.PluginError.ToString()
|
|
|
},
|
|
},
|
|
|
-
|
|
|
|
|
new NotificationTypeInfo
|
|
new NotificationTypeInfo
|
|
|
{
|
|
{
|
|
|
Type = NotificationType.PluginUninstalled.ToString()
|
|
Type = NotificationType.PluginUninstalled.ToString()
|
|
|
},
|
|
},
|
|
|
-
|
|
|
|
|
new NotificationTypeInfo
|
|
new NotificationTypeInfo
|
|
|
{
|
|
{
|
|
|
Type = NotificationType.PluginUpdateInstalled.ToString()
|
|
Type = NotificationType.PluginUpdateInstalled.ToString()
|
|
|
},
|
|
},
|
|
|
-
|
|
|
|
|
new NotificationTypeInfo
|
|
new NotificationTypeInfo
|
|
|
{
|
|
{
|
|
|
Type = NotificationType.ServerRestartRequired.ToString()
|
|
Type = NotificationType.ServerRestartRequired.ToString()
|
|
|
},
|
|
},
|
|
|
-
|
|
|
|
|
new NotificationTypeInfo
|
|
new NotificationTypeInfo
|
|
|
{
|
|
{
|
|
|
Type = NotificationType.TaskFailed.ToString()
|
|
Type = NotificationType.TaskFailed.ToString()
|
|
|
},
|
|
},
|
|
|
-
|
|
|
|
|
new NotificationTypeInfo
|
|
new NotificationTypeInfo
|
|
|
{
|
|
{
|
|
|
Type = NotificationType.NewLibraryContent.ToString()
|
|
Type = NotificationType.NewLibraryContent.ToString()
|
|
|
},
|
|
},
|
|
|
-
|
|
|
|
|
new NotificationTypeInfo
|
|
new NotificationTypeInfo
|
|
|
{
|
|
{
|
|
|
Type = NotificationType.AudioPlayback.ToString()
|
|
Type = NotificationType.AudioPlayback.ToString()
|
|
|
},
|
|
},
|
|
|
-
|
|
|
|
|
new NotificationTypeInfo
|
|
new NotificationTypeInfo
|
|
|
{
|
|
{
|
|
|
Type = NotificationType.VideoPlayback.ToString()
|
|
Type = NotificationType.VideoPlayback.ToString()
|
|
|
},
|
|
},
|
|
|
-
|
|
|
|
|
new NotificationTypeInfo
|
|
new NotificationTypeInfo
|
|
|
{
|
|
{
|
|
|
Type = NotificationType.AudioPlaybackStopped.ToString()
|
|
Type = NotificationType.AudioPlaybackStopped.ToString()
|
|
|
},
|
|
},
|
|
|
-
|
|
|
|
|
new NotificationTypeInfo
|
|
new NotificationTypeInfo
|
|
|
{
|
|
{
|
|
|
Type = NotificationType.VideoPlaybackStopped.ToString()
|
|
Type = NotificationType.VideoPlaybackStopped.ToString()
|
|
|
},
|
|
},
|
|
|
-
|
|
|
|
|
new NotificationTypeInfo
|
|
new NotificationTypeInfo
|
|
|
{
|
|
{
|
|
|
Type = NotificationType.CameraImageUploaded.ToString()
|
|
Type = NotificationType.CameraImageUploaded.ToString()
|
|
|
},
|
|
},
|
|
|
-
|
|
|
|
|
new NotificationTypeInfo
|
|
new NotificationTypeInfo
|
|
|
{
|
|
{
|
|
|
Type = NotificationType.UserLockedOut.ToString()
|
|
Type = NotificationType.UserLockedOut.ToString()
|
|
|
- }
|
|
|
|
|
- };
|
|
|
|
|
-
|
|
|
|
|
- if (!_appHost.CanSelfUpdate)
|
|
|
|
|
- {
|
|
|
|
|
- knownTypes.Add(new NotificationTypeInfo
|
|
|
|
|
|
|
+ },
|
|
|
|
|
+ new NotificationTypeInfo
|
|
|
{
|
|
{
|
|
|
Type = NotificationType.ApplicationUpdateAvailable.ToString()
|
|
Type = NotificationType.ApplicationUpdateAvailable.ToString()
|
|
|
- });
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ }
|
|
|
|
|
+ };
|
|
|
|
|
|
|
|
foreach (var type in knownTypes)
|
|
foreach (var type in knownTypes)
|
|
|
{
|
|
{
|