Skip to content

Commit

Permalink
Properly set usertype for Jellyfin users
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuaboniface committed Dec 12, 2020
1 parent 30cd96f commit f52a74e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Ombi.Schedule/Jobs/Jellyfin/JellyfinUserImporter.cs
Expand Up @@ -103,20 +103,21 @@ await _notification.Clients.Clients(NotificationHub.AdminConnectionIds)
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);
continue;
}
var isConnectUser = jellyfinUser.ConnectUserName.HasValue();
// Create this users
var newUser = new OmbiUser
{
UserName = jellyfinUser.Name,
UserType = UserType.JellyfinUser,
ProviderUserId = jellyfinUser.Id,
MovieRequestLimit = userManagementSettings.MovieRequestLimit,
EpisodeRequestLimit = userManagementSettings.EpisodeRequestLimit
};
_log.LogInformation("Creating Jellyfin user {0}", newUser.UserName);
var result = await _userManager.CreateAsync(newUser);
if (!result.Succeeded)
{
Expand Down

0 comments on commit f52a74e

Please sign in to comment.