aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Server.Implementations
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2014-04-27 15:30:12 -0400
committerLuke Pulverenti <luke.pulverenti@gmail.com>2014-04-27 15:30:12 -0400
commit3db92516bea0f473022f257dd61dfeafa6998c75 (patch)
treea7a03317f913d85c2e634770ec1963c2a38cad78 /MediaBrowser.Server.Implementations
parentf476944d9168c7c8a8a87e7e439f57ef8aceb4be (diff)
updated nuget
Diffstat (limited to 'MediaBrowser.Server.Implementations')
-rw-r--r--MediaBrowser.Server.Implementations/EntryPoints/Notifications/Notifier.cs4
-rw-r--r--MediaBrowser.Server.Implementations/Notifications/NotificationManager.cs20
2 files changed, 9 insertions, 15 deletions
diff --git a/MediaBrowser.Server.Implementations/EntryPoints/Notifications/Notifier.cs b/MediaBrowser.Server.Implementations/EntryPoints/Notifications/Notifier.cs
index 06dcf92ff..217b068bf 100644
--- a/MediaBrowser.Server.Implementations/EntryPoints/Notifications/Notifier.cs
+++ b/MediaBrowser.Server.Implementations/EntryPoints/Notifications/Notifier.cs
@@ -149,7 +149,9 @@ namespace MediaBrowser.Server.Implementations.EntryPoints.Notifications
var notification = new NotificationRequest
{
- NotificationType = GetPlaybackNotificationType(item.MediaType)
+ NotificationType = GetPlaybackNotificationType(item.MediaType),
+
+ ExcludeUserIds = e.Users.Select(i => i.Id.ToString("N")).ToList()
};
notification.Variables["ItemName"] = item.Name;
diff --git a/MediaBrowser.Server.Implementations/Notifications/NotificationManager.cs b/MediaBrowser.Server.Implementations/Notifications/NotificationManager.cs
index 300d2c351..f3183ec0b 100644
--- a/MediaBrowser.Server.Implementations/Notifications/NotificationManager.cs
+++ b/MediaBrowser.Server.Implementations/Notifications/NotificationManager.cs
@@ -38,7 +38,9 @@ namespace MediaBrowser.Server.Implementations.Notifications
null :
_config.Configuration.NotificationOptions.GetOptions(notificationType);
- var users = GetUserIds(request, options).Select(i => _userManager.GetUserById(new Guid(i)));
+ var users = GetUserIds(request, options)
+ .Except(request.UserIds)
+ .Select(i => _userManager.GetUserById(new Guid(i)));
var title = GetTitle(request, options);
@@ -81,20 +83,10 @@ namespace MediaBrowser.Server.Implementations.Notifications
}
}
- if (options != null)
+ if (options != null && !string.IsNullOrWhiteSpace(request.NotificationType))
{
- switch (options.SendToUserMode)
- {
- case SendToUserType.Admins:
- return _userManager.Users.Where(i => i.Configuration.IsAdministrator)
- .Select(i => i.Id.ToString("N"));
- case SendToUserType.All:
- return _userManager.Users.Select(i => i.Id.ToString("N"));
- case SendToUserType.Custom:
- return options.SendToUsers;
- default:
- throw new ArgumentException("Unrecognized SendToUserMode: " + options.SendToUserMode);
- }
+ return _userManager.Users.Where(i => _config.Configuration.NotificationOptions.IsEnabledToSendToUser(request.NotificationType, i.Id.ToString("N"), i.Configuration))
+ .Select(i => i.Id.ToString("N"));
}
return new List<string>();