From 596bf3a3785129fc0ccebab26754fc5f7673a56e Mon Sep 17 00:00:00 2001 From: sel10ut <45976019+sel10ut@users.noreply.github.com> Date: Sat, 29 Jun 2024 00:26:01 +0300 Subject: [PATCH] fix(jellyfin): allow multiple sessions from the same client type Allow multiple sessions from the same user with different instances. Instead of sending a hard-coded string, send a randomly generated string `deviceId`, which already exists and is created for each new installation. --- src/renderer/api/jellyfin/jellyfin-controller.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/renderer/api/jellyfin/jellyfin-controller.ts b/src/renderer/api/jellyfin/jellyfin-controller.ts index ff07ebc5..48376a47 100644 --- a/src/renderer/api/jellyfin/jellyfin-controller.ts +++ b/src/renderer/api/jellyfin/jellyfin-controller.ts @@ -64,6 +64,7 @@ import isElectron from 'is-electron'; import { ServerFeature } from '/@/renderer/api/features-types'; import { VersionInfo, getFeatures } from '/@/renderer/api/utils'; import chunk from 'lodash/chunk'; +import { useAuthStore } from '/@/renderer/store'; const formatCommaDelimitedString = (value: string[]) => { return value.join(','); @@ -109,9 +110,9 @@ const authenticate = async ( Username: body.username, }, headers: { - 'x-emby-authorization': `MediaBrowser Client="Feishin", Device="${getHostname()}", DeviceId="Feishin-${getHostname()}-${encodeURIComponent( - body.username, - )}", Version="${packageJson.version}"`, + 'x-emby-authorization': `MediaBrowser Client="Feishin", Device="${getHostname()}", DeviceId="${ + useAuthStore.getState().deviceId + }", Version="${packageJson.version}"`, }, });