Fixed emby connect login issue

This commit is contained in:
tidusjar 2017-12-15 21:44:59 +00:00
parent 52a22b3a60
commit 6ad6dd4a74
2 changed files with 5 additions and 2 deletions

View file

@ -111,11 +111,13 @@ namespace Ombi.Core.Authentication
// We cannot update the email address in the user importer due to there is no way
// To get this info from Emby Connect without the username and password.
// So we do it here!
if (!user.Email.Equals(result.User?.Email))
var email = user.Email ?? string.Empty;
if (!email.Equals(result.User?.Email))
{
user.Email = result.User?.Email;
await UpdateAsync(user);
}
return true;
}
}

View file

@ -50,6 +50,7 @@ namespace Ombi.Schedule.Jobs.Emby
_embySettings = embySettings;
_userManagementSettings = ums;
_userManagementSettings.ClearCache();
_embySettings.ClearCache();
}
private readonly IEmbyApi _api;
@ -97,7 +98,7 @@ namespace Ombi.Schedule.Jobs.Emby
var newUser = new OmbiUser
{
UserType = UserType.EmbyUser,
UserName = embyUser.Name,
UserName = embyUser.ConnectUserName.HasValue() ? embyUser.ConnectUserName : embyUser.Name,
ProviderUserId = embyUser.Id,
Alias = string.Empty,
EmbyConnectUserId = embyUser.ConnectUserId.HasValue() ? embyUser.ConnectUserId : string.Empty,