Skip to content

Commit

Permalink
fix: 🩹 Disabled access to Live TV Management for Jellyfin/Emby
Browse files Browse the repository at this point in the history
  • Loading branch information
JamsRepos committed Apr 30, 2024
1 parent fd52649 commit a603d56
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
9 changes: 3 additions & 6 deletions apps/wizarr-backend/wizarr_backend/helpers/emby.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,8 +253,6 @@ def invite_emby_user(username: str, password: str, code: str, server_api_key: Op
if invitation.specific_libraries is not None and len(invitation.specific_libraries) > 0:
sections = invitation.specific_libraries.split(",")

print(sections)

# Create user object
new_user = { "Name": str(username) }

Expand All @@ -264,6 +262,9 @@ def invite_emby_user(username: str, password: str, code: str, server_api_key: Op
# Create policy object
new_policy = {
"EnableAllFolders": True,
"SimultaneousStreamLimit": 0,
"EnableLiveTvAccess": False,
"EnableLiveTvManagement": False,
"AuthenticationProviderId": "Emby.Server.Implementations.Library.DefaultAuthenticationProvider",
}

Expand All @@ -275,14 +276,10 @@ def invite_emby_user(username: str, password: str, code: str, server_api_key: Op
# Set stream limit options
if invitation.sessions is not None and int(invitation.sessions) > 0:
new_policy["SimultaneousStreamLimit"] = int(invitation.sessions)
else:
new_policy["SimultaneousStreamLimit"] = 0

# Set live tv access
if invitation.live_tv is not None and invitation.live_tv == True:
new_policy["EnableLiveTvAccess"] = True
else:
new_policy["EnableLiveTvAccess"] = False

# Get users default policy
old_policy = user_response["Policy"]
Expand Down
7 changes: 3 additions & 4 deletions apps/wizarr-backend/wizarr_backend/helpers/jellyfin.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,9 @@ def invite_jellyfin_user(username: str, password: str, code: str, server_api_key
# Create policy object
new_policy = {
"EnableAllFolders": True,
"MaxActiveSessions": 0,
"EnableLiveTvAccess": False,
"EnableLiveTvManagement": False,
"AuthenticationProviderId": "Jellyfin.Server.Implementations.Users.DefaultAuthenticationProvider",
}

Expand All @@ -273,14 +276,10 @@ def invite_jellyfin_user(username: str, password: str, code: str, server_api_key
# Set session limit options
if invitation.sessions is not None and int(invitation.sessions) > 0:
new_policy["MaxActiveSessions"] = int(invitation.sessions)
else:
new_policy["MaxActiveSessions"] = 0

# Set live tv access
if invitation.live_tv is not None and invitation.live_tv == True:
new_policy["EnableLiveTvAccess"] = True
else:
new_policy["EnableLiveTvAccess"] = False

# Get users default policy
old_policy = user_response["Policy"]
Expand Down

0 comments on commit a603d56

Please sign in to comment.