mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-07-16 02:02:55 -07:00
Fixed #1036
This commit is contained in:
parent
d050fa129f
commit
a206141f98
3 changed files with 46 additions and 12 deletions
|
@ -171,8 +171,9 @@ namespace Ombi.Services.Notification
|
|||
try
|
||||
{
|
||||
var settings = await PlexSettings.GetSettingsAsync();
|
||||
var plexUser = PlexApi.GetUsers(settings.PlexAuthToken);
|
||||
var plexUser = PlexApi.GetUsers(settings.PlexAuthToken); // TODO emby
|
||||
var userAccount = PlexApi.GetAccount(settings.PlexAuthToken);
|
||||
var localUsers = UserHelper.GetUsers().ToList();
|
||||
|
||||
var adminUsername = userAccount.Username ?? string.Empty;
|
||||
|
||||
|
@ -219,11 +220,17 @@ namespace Ombi.Services.Notification
|
|||
}
|
||||
|
||||
var email = plexUser.User.FirstOrDefault(x => x.Username.Equals(user, StringComparison.CurrentCultureIgnoreCase));
|
||||
if (email == null)
|
||||
if (email == null) // This is not a Plex User
|
||||
{
|
||||
Log.Info("There is no email address for this Plex user, cannot send notification");
|
||||
// We do not have a plex user that requested this!
|
||||
continue;
|
||||
// Local User?
|
||||
var local = localUsers.FirstOrDefault(x => x.UsernameOrAlias.Equals(user));
|
||||
if (local != null)
|
||||
{
|
||||
|
||||
Log.Info("Sending notification to: {0} at: {1}, for title: {2}", local.UsernameOrAlias, local.EmailAddress, model.Title);
|
||||
await PublishUserNotification(local.UsernameOrAlias, local.EmailAddress, model.Title, model.PosterPath, type, model.Type);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
Log.Info("Sending notification to: {0} at: {1}, for title: {2}", email.Username, email.Email, model.Title);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue