diff options
| author | Luke <luke.pulverenti@gmail.com> | 2017-10-24 01:20:09 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-10-24 01:20:09 -0400 |
| commit | 0aac8045fb69ad1024859812a09e68070ea698f6 (patch) | |
| tree | 6e8b55133b0eeee606df5049497b80a612843733 /Emby.Server.Implementations/Notifications/NotificationManager.cs | |
| parent | 7924bb7c9add449f61d8695add6f2f3fcbc18a0a (diff) | |
| parent | 6c5f3ce07e8b36299a4143dc609999d880e7bdfd (diff) | |
Merge pull request #2974 from MediaBrowser/beta
Beta
Diffstat (limited to 'Emby.Server.Implementations/Notifications/NotificationManager.cs')
| -rw-r--r-- | Emby.Server.Implementations/Notifications/NotificationManager.cs | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/Emby.Server.Implementations/Notifications/NotificationManager.cs b/Emby.Server.Implementations/Notifications/NotificationManager.cs index f49d5a1d1..e11f2790e 100644 --- a/Emby.Server.Implementations/Notifications/NotificationManager.cs +++ b/Emby.Server.Implementations/Notifications/NotificationManager.cs @@ -38,6 +38,11 @@ namespace Emby.Server.Implementations.Notifications public Task SendNotification(NotificationRequest request, CancellationToken cancellationToken) { + return SendNotification(request, null, cancellationToken); + } + + public Task SendNotification(NotificationRequest request, BaseItem relatedItem, CancellationToken cancellationToken) + { var notificationType = request.NotificationType; var options = string.IsNullOrWhiteSpace(notificationType) ? @@ -45,7 +50,9 @@ namespace Emby.Server.Implementations.Notifications GetConfiguration().GetOptions(notificationType); var users = GetUserIds(request, options) - .Select(i => _userManager.GetUserById(i)); + .Select(i => _userManager.GetUserById(i)) + .Where(i => relatedItem == null || relatedItem.IsVisibleStandalone(i)) + .ToArray(); var title = GetTitle(request, options); var description = GetDescription(request, options); @@ -69,7 +76,6 @@ namespace Emby.Server.Implementations.Notifications var tasks = users.Select(i => SendNotification(request, service, title, description, i, cancellationToken)); return Task.WhenAll(tasks); - } private IEnumerable<string> GetUserIds(NotificationRequest request, NotificationOption options) |
