The Free Software Media System - Server Backend & API
updated nuget
Luke Pulverenti3db92516bea0
diff --git a/MediaBrowser.Model/Notifications/Notification.cs b/MediaBrowser.Model/Notifications/Notification.csindex e69875a68a..e5040373b2 100644--- a/MediaBrowser.Model/Notifications/Notification.cs+++ b/MediaBrowser.Model/Notifications/Notification.cs@@ -1,6 +1,6 @@-using System;+using MediaBrowser.Model.Configuration;+using System;using System.Collections.Generic;-using MediaBrowser.Model.Configuration;namespace MediaBrowser.Model.Notifications{@@ -50,13 +50,17 @@ namespace MediaBrowser.Model.Notificationspublic Dictionary<string, string> Variables { get; set; }public SendToUserType? SendToUserMode { get; set; }-++ public List<string> ExcludeUserIds { get; set; }+public NotificationRequest(){UserIds = new List<string>();Date = DateTime.UtcNow;Variables = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);++ ExcludeUserIds = new List<string>();}}diff --git a/MediaBrowser.Server.Implementations/EntryPoints/Notifications/Notifier.cs b/MediaBrowser.Server.Implementations/EntryPoints/Notifications/Notifier.csindex 06dcf92ff8..217b068bf1 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.Notificationsvar 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.csindex 300d2c351e..f3183ec0b0 100644--- a/MediaBrowser.Server.Implementations/Notifications/NotificationManager.cs+++ b/MediaBrowser.Server.Implementations/Notifications/NotificationManager.cs@@ -38,7 +38,9 @@ namespace MediaBrowser.Server.Implementations.Notificationsnull :_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>();diff --git a/Nuget/MediaBrowser.Common.Internal.nuspec b/Nuget/MediaBrowser.Common.Internal.nuspecindex 91329e9b42..be0925a5f2 100644--- a/Nuget/MediaBrowser.Common.Internal.nuspec+++ b/Nuget/MediaBrowser.Common.Internal.nuspec@@ -2,7 +2,7 @@<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd"><metadata><id>MediaBrowser.Common.Internal</id>- <version>3.0.355</version>+ <version>3.0.356</version><title>MediaBrowser.Common.Internal</title><authors>Luke</authors><owners>ebr,Luke,scottisafool</owners>@@ -12,7 +12,7 @@<description>Contains common components shared by Media Browser Theater and Media Browser Server. Not intended for plugin developer consumption.</description><copyright>Copyright © Media Browser 2013</copyright><dependencies>- <dependency id="MediaBrowser.Common" version="3.0.355" />+ <dependency id="MediaBrowser.Common" version="3.0.356" /><dependency id="NLog" version="2.1.0" /><dependency id="SimpleInjector" version="2.4.1" /><dependency id="sharpcompress" version="0.10.2" />diff --git a/Nuget/MediaBrowser.Common.nuspec b/Nuget/MediaBrowser.Common.nuspecindex adef971ce0..c2ac5f7cf0 100644--- a/Nuget/MediaBrowser.Common.nuspec+++ b/Nuget/MediaBrowser.Common.nuspec@@ -2,7 +2,7 @@<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd"><metadata><id>MediaBrowser.Common</id>- <version>3.0.355</version>+ <version>3.0.356</version><title>MediaBrowser.Common</title><authors>Media Browser Team</authors><owners>ebr,Luke,scottisafool</owners>diff --git a/Nuget/MediaBrowser.Server.Core.nuspec b/Nuget/MediaBrowser.Server.Core.nuspecindex ad00362a59..d64be0f3c3 100644--- a/Nuget/MediaBrowser.Server.Core.nuspec+++ b/Nuget/MediaBrowser.Server.Core.nuspec@@ -2,7 +2,7 @@<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd"><metadata><id>MediaBrowser.Server.Core</id>- <version>3.0.355</version>+ <version>3.0.356</version><title>Media Browser.Server.Core</title><authors>Media Browser Team</authors><owners>ebr,Luke,scottisafool</owners>@@ -12,7 +12,7 @@<description>Contains core components required to build plugins for Media Browser Server.</description><copyright>Copyright © Media Browser 2013</copyright><dependencies>- <dependency id="MediaBrowser.Common" version="3.0.355" />+ <dependency id="MediaBrowser.Common" version="3.0.356" /></dependencies></metadata><files>