Skip to content

Commit

Permalink
Fixed Ombi-app#985
Browse files Browse the repository at this point in the history
  • Loading branch information
Jamie.Rees authored and Jamie.Rees committed Jan 30, 2017
1 parent 129269c commit e5835bf
Showing 1 changed file with 25 additions and 4 deletions.
29 changes: 25 additions & 4 deletions Ombi.Services/Notification/NotificationEngine.cs
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,31 @@ public async Task NotifyUsers(IEnumerable<RequestedModel> modelChanged, string a
return;
}

var localUser =
users.FirstOrDefault( x =>
x.Username.Equals(user, StringComparison.CurrentCultureIgnoreCase) ||
x.UserAlias.Equals(user, StringComparison.CurrentCultureIgnoreCase));
UserHelperModel localUser = null;
//users.FirstOrDefault( x =>
// x.Username.Equals(user, StringComparison.CurrentCultureIgnoreCase) ||
// x.UserAlias.Equals(user, StringComparison.CurrentCultureIgnoreCase));

foreach (var userHelperModel in users)
{
if (!string.IsNullOrEmpty(userHelperModel.Username))
{
if (userHelperModel.Username.Equals(user, StringComparison.CurrentCultureIgnoreCase))
{
localUser = userHelperModel;
break;
}
}
if (!string.IsNullOrEmpty(userHelperModel.UserAlias))
{
if (userHelperModel.UserAlias.Equals(user, StringComparison.CurrentCultureIgnoreCase))
{
localUser = userHelperModel;
break;
}
}
}


// So if the request was from an alias, then we need to use the local user (since that contains the alias).
// If we do not have a local user, then we should be using the Plex user if that user exists.
Expand Down

0 comments on commit e5835bf

Please sign in to comment.