more small tweaks around the username/alias

This commit is contained in:
Jamie.Rees 2017-01-25 12:03:55 +00:00
commit 3d2209d163
6 changed files with 23 additions and 7 deletions

View file

@ -152,10 +152,16 @@ namespace Ombi.Services.Notification
var users = UserHelper.GetUsersWithFeature(Features.RequestAddedNotification).ToList();
Log.Debug("Notifying Users Count {0}", users.Count);
var userNamesWithFeature = users.Select(x => x.Username).ToList();
// Get the usernames or alias depending if they have an alias
var userNamesWithFeature = users.Select(x => x.UsernameOrAlias).ToList();
var usersToNotify = userNamesWithFeature.Intersect(model.AllUsers, StringComparer.CurrentCultureIgnoreCase).ToList();
if (!usersToNotify.Any())
{
Log.Debug("Could not find any users after the .Intersect()");
}
var usersToNotify = userNamesWithFeature.Intersect(model.AllUsers, StringComparer.CurrentCultureIgnoreCase);
Log.Debug("Users being notified for this request count {0}", users.Count);
foreach (var user in usersToNotify)
{