diff options
| author | dkanada <dkanada@users.noreply.github.com> | 2021-02-23 19:19:38 +0900 |
|---|---|---|
| committer | dkanada <dkanada@users.noreply.github.com> | 2021-02-23 19:19:38 +0900 |
| commit | bc746b4d05f440b4910751ab7ae70e81ad470892 (patch) | |
| tree | 0642ed74e91511214e4d4b8a3beb40b9c7a8e7d4 /MediaBrowser.Model/Notifications | |
| parent | 9caf3119257544d6fb8fd3e1f1cb2b50eba7bd39 (diff) | |
| parent | 7ece3c552337340a997a75aab1520a501a673f61 (diff) | |
merge branch 'master' into auto-manifest
Diffstat (limited to 'MediaBrowser.Model/Notifications')
| -rw-r--r-- | MediaBrowser.Model/Notifications/NotificationOptions.cs | 10 | ||||
| -rw-r--r-- | MediaBrowser.Model/Notifications/NotificationRequest.cs | 14 |
2 files changed, 12 insertions, 12 deletions
diff --git a/MediaBrowser.Model/Notifications/NotificationOptions.cs b/MediaBrowser.Model/Notifications/NotificationOptions.cs index 239a3777e..94bb5d6e3 100644 --- a/MediaBrowser.Model/Notifications/NotificationOptions.cs +++ b/MediaBrowser.Model/Notifications/NotificationOptions.cs @@ -2,18 +2,16 @@ #pragma warning disable CS1591 using System; -using Jellyfin.Data.Enums; -using MediaBrowser.Model.Extensions; using System.Linq; using Jellyfin.Data.Entities; +using Jellyfin.Data.Enums; +using MediaBrowser.Model.Extensions; using MediaBrowser.Model.Users; namespace MediaBrowser.Model.Notifications { public class NotificationOptions { - public NotificationOption[] Options { get; set; } - public NotificationOptions() { Options = new[] @@ -71,6 +69,8 @@ namespace MediaBrowser.Model.Notifications }; } + public NotificationOption[] Options { get; set; } + public NotificationOption GetOptions(string type) { foreach (NotificationOption i in Options) @@ -104,7 +104,7 @@ namespace MediaBrowser.Model.Notifications NotificationOption opt = GetOptions(type); return opt != null && opt.Enabled && - !opt.DisabledMonitorUsers.Contains(userId.ToString(""), StringComparer.OrdinalIgnoreCase); + !opt.DisabledMonitorUsers.Contains(userId.ToString(string.Empty), StringComparer.OrdinalIgnoreCase); } public bool IsEnabledToSendToUser(string type, string userId, User user) diff --git a/MediaBrowser.Model/Notifications/NotificationRequest.cs b/MediaBrowser.Model/Notifications/NotificationRequest.cs index febc2bc09..622c50cd8 100644 --- a/MediaBrowser.Model/Notifications/NotificationRequest.cs +++ b/MediaBrowser.Model/Notifications/NotificationRequest.cs @@ -7,6 +7,12 @@ namespace MediaBrowser.Model.Notifications { public class NotificationRequest { + public NotificationRequest() + { + UserIds = Array.Empty<Guid>(); + Date = DateTime.UtcNow; + } + public string Name { get; set; } public string Description { get; set; } @@ -20,16 +26,10 @@ namespace MediaBrowser.Model.Notifications public DateTime Date { get; set; } /// <summary> - /// The corresponding type name used in configuration. Not for display. + /// Gets or sets the corresponding type name used in configuration. Not for display. /// </summary> public string NotificationType { get; set; } public SendToUserType? SendToUserMode { get; set; } - - public NotificationRequest() - { - UserIds = Array.Empty<Guid>(); - Date = DateTime.UtcNow; - } } } |
