Skip to content

Commit

Permalink
feat: ✨ ✨ Emby users can now set max streams
Browse files Browse the repository at this point in the history
  • Loading branch information
JamsRepos committed Apr 22, 2024
1 parent eb54d32 commit 3b0d4e0
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 2 deletions.
7 changes: 7 additions & 0 deletions apps/wizarr-backend/wizarr_backend/helpers/emby.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,10 +267,17 @@ def invite_emby_user(username: str, password: str, code: str, server_api_key: Op
# Create policy object
new_policy = { "EnableAllFolders": True }

# Set library options
if sections:
new_policy["EnableAllFolders"] = False
new_policy["EnabledFolders"] = sections

# 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

old_policy = user_response["Policy"]

# Merge policy with user policy don't overwrite
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ export default defineComponent({
selects: {
jellyfin: {
sessions: {
label: "Maximum Number of Simultaneous User Logins",
label: "Maximum Number of Simultaneous Logins",
options: {
0: "No Limit",
1: "1 Session",
Expand All @@ -221,6 +221,24 @@ export default defineComponent({
},
},
},
emby: {
sessions: {
label: "Maximum Number of Simultaneous Streams",
options: {
0: "No Limit",
1: "1 Stream",
2: "2 Streams",
3: "3 Streams",
4: "4 Streams",
5: "5 Streams",
6: "6 Streams",
7: "7 Streams",
8: "8 Streams",
9: "9 Streams",
10: "10 Streams",
},
},
},
} as Record<string, Record<string, { label: string; options: Record<number, string> }>>,
advancedOptions: false,
clipboardToast: null as ToastID | null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ export default defineComponent({
selects: {
jellyfin: {
sessions: {
label: "Maximum Number of Simultaneous User Logins",
label: "Maximum Number of Simultaneous Logins",
value: this.invitation.sessions,
options: {
0: "No Limit",
Expand All @@ -144,6 +144,25 @@ export default defineComponent({
},
},
},
emby: {
sessions: {
label: "Maximum Number of Simultaneous Streams",
value: this.invitation.sessions,
options: {
0: "No Limit",
1: "1 Stream",
2: "2 Streams",
3: "3 Streams",
4: "4 Streams",
5: "5 Streams",
6: "6 Streams",
7: "7 Streams",
8: "8 Streams",
9: "9 Streams",
10: "10 Streams",
},
},
},
} as Record<string, Record<string, { label: string; value: number, options: Record<number, string> }>>,
clipboard: useClipboard({
legacy: true,
Expand Down

0 comments on commit 3b0d4e0

Please sign in to comment.