Fixed emby connect login issue

pull/1805/head
tidusjar 7 years ago
parent 52a22b3a60
commit 6ad6dd4a74

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

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

Loading…
Cancel
Save