aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Api/NotificationsService.cs
diff options
context:
space:
mode:
Diffstat (limited to 'MediaBrowser.Api/NotificationsService.cs')
-rw-r--r--MediaBrowser.Api/NotificationsService.cs9
1 files changed, 7 insertions, 2 deletions
diff --git a/MediaBrowser.Api/NotificationsService.cs b/MediaBrowser.Api/NotificationsService.cs
index 51a080106..5103d1b5c 100644
--- a/MediaBrowser.Api/NotificationsService.cs
+++ b/MediaBrowser.Api/NotificationsService.cs
@@ -135,7 +135,7 @@ namespace MediaBrowser.Api
Level = request.Level,
Name = request.Name,
Url = request.Url,
- UserIds = _userManager.Users.Where(i => i.Configuration.IsAdministrator).Select(i => i.Id.ToString("N")).ToList()
+ UserIds = _userManager.Users.Where(i => i.Policy.IsAdministrator).Select(i => i.Id.ToString("N")).ToList()
};
await _notificationManager.SendNotification(notification, CancellationToken.None).ConfigureAwait(false);
@@ -157,7 +157,12 @@ namespace MediaBrowser.Api
private Task MarkRead(string idList, string userId, bool read)
{
- var ids = idList.Split(',');
+ var ids = (idList ?? string.Empty).Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
+
+ if (ids.Length == 0)
+ {
+ return _notificationsRepo.MarkAllRead(userId, read, CancellationToken.None);
+ }
return _notificationsRepo.MarkRead(ids, userId, read, CancellationToken.None);
}