Properly set usertype for Jellyfin users

pull/3924/head
Joshua M. Boniface 4 years ago
parent 30cd96f82a
commit f52a74eba6

@ -103,20 +103,21 @@ namespace Ombi.Schedule.Jobs.Jellyfin
if (existingJellyfinUser == null) if (existingJellyfinUser == null)
{ {
if (!jellyfinUser.ConnectUserName.HasValue() && !jellyfinUser.Name.HasValue()) if (!jellyfinUser.Name.HasValue())
{ {
_log.LogInformation("Could not create Jellyfin user since the have no username, JellyfinUserId: {0}", jellyfinUser.Id); _log.LogInformation("Could not create Jellyfin user since the have no username, JellyfinUserId: {0}", jellyfinUser.Id);
continue; continue;
} }
var isConnectUser = jellyfinUser.ConnectUserName.HasValue();
// Create this users // Create this users
var newUser = new OmbiUser var newUser = new OmbiUser
{ {
UserName = jellyfinUser.Name, UserName = jellyfinUser.Name,
UserType = UserType.JellyfinUser,
ProviderUserId = jellyfinUser.Id, ProviderUserId = jellyfinUser.Id,
MovieRequestLimit = userManagementSettings.MovieRequestLimit, MovieRequestLimit = userManagementSettings.MovieRequestLimit,
EpisodeRequestLimit = userManagementSettings.EpisodeRequestLimit EpisodeRequestLimit = userManagementSettings.EpisodeRequestLimit
}; };
_log.LogInformation("Creating Jellyfin user {0}", newUser.UserName);
var result = await _userManager.CreateAsync(newUser); var result = await _userManager.CreateAsync(newUser);
if (!result.Succeeded) if (!result.Succeeded)
{ {

Loading…
Cancel
Save