diff --git a/Ombi.Services/Notification/NotificationEngine.cs b/Ombi.Services/Notification/NotificationEngine.cs index 01b50898b..49340ca1a 100644 --- a/Ombi.Services/Notification/NotificationEngine.cs +++ b/Ombi.Services/Notification/NotificationEngine.cs @@ -154,7 +154,25 @@ namespace Ombi.Services.Notification // Get the usernames or alias depending if they have an alias var userNamesWithFeature = users.Select(x => x.UsernameOrAlias).ToList(); + Log.Debug("Users with the feature count {0}", userNamesWithFeature.Count); + Log.Debug("Usernames: "); + foreach (var u in userNamesWithFeature) + { + Log.Debug(u); + } + Log.Debug("Users in the requested model count: {0}", model.AllUsers.Count); + Log.Debug("usernames from model: "); + foreach (var modelAllUser in model.AllUsers) + { + Log.Debug(modelAllUser); + } + + if (model.AllUsers == null || !model.AllUsers.Any()) + { + Log.Debug("There are no users in the model.AllUsers, no users to notify"); + return; + } var usersToNotify = userNamesWithFeature.Intersect(model.AllUsers, StringComparer.CurrentCultureIgnoreCase).ToList(); if (!usersToNotify.Any()) diff --git a/Ombi.Store/RequestedModel.cs b/Ombi.Store/RequestedModel.cs index 6d0342a14..c54d68e5c 100644 --- a/Ombi.Store/RequestedModel.cs +++ b/Ombi.Store/RequestedModel.cs @@ -27,9 +27,6 @@ namespace Ombi.Store public string Status { get; set; } public bool Approved { get; set; } - [Obsolete("Use RequestedUsers")] //TODO remove this obsolete property - public string RequestedBy { get; set; } - public DateTime RequestedDate { get; set; } public bool Available { get; set; } public IssueState Issues { get; set; } @@ -60,14 +57,9 @@ namespace Ombi.Store get { var u = new List(); - if (!string.IsNullOrEmpty(RequestedBy)) - { - u.Add(RequestedBy); - } - if (RequestedUsers != null && RequestedUsers.Any()) { - u.AddRange(RequestedUsers.Where(requestedUser => requestedUser != RequestedBy)); + u.AddRange(RequestedUsers); } return u; }