Skip to content

Commit

Permalink
fix: 🚑 Changed order of Emby user password creation
Browse files Browse the repository at this point in the history
  • Loading branch information
JamsRepos committed Apr 30, 2024
1 parent 9c6ea38 commit fd52649
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions apps/wizarr-backend/wizarr_backend/helpers/emby.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,9 +261,6 @@ def invite_emby_user(username: str, password: str, code: str, server_api_key: Op
# Create user in Emby
user_response = post_emby(api_path="/Users/New", json=new_user, server_api_key=server_api_key, server_url=server_url)

# Set user password
post_emby(api_path=f"/Users/{user_response['Id']}/Password", json={"NewPw": str(password)}, server_api_key=server_api_key, server_url=server_url)

# Create policy object
new_policy = {
"EnableAllFolders": True,
Expand Down Expand Up @@ -299,6 +296,9 @@ def invite_emby_user(username: str, password: str, code: str, server_api_key: Op
# Update user policy
post_emby(api_path=api_path, json=new_policy, server_api_key=server_api_key, server_url=server_url)

# Set user password, this is done after the policy is set due to LDAP policies
post_emby(api_path=f"/Users/{user_response['Id']}/Password", json={"NewPw": str(password)}, server_api_key=server_api_key, server_url=server_url)

# Return response
return user_response

Expand Down

0 comments on commit fd52649

Please sign in to comment.