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.
This commit is contained in:
sel10ut 2024-06-29 00:26:01 +03:00
parent b30fadd149
commit 596bf3a378
No known key found for this signature in database
GPG key ID: D0B72B1CF829F342

View file

@ -64,6 +64,7 @@ import isElectron from 'is-electron';
import { ServerFeature } from '/@/renderer/api/features-types'; import { ServerFeature } from '/@/renderer/api/features-types';
import { VersionInfo, getFeatures } from '/@/renderer/api/utils'; import { VersionInfo, getFeatures } from '/@/renderer/api/utils';
import chunk from 'lodash/chunk'; import chunk from 'lodash/chunk';
import { useAuthStore } from '/@/renderer/store';
const formatCommaDelimitedString = (value: string[]) => { const formatCommaDelimitedString = (value: string[]) => {
return value.join(','); return value.join(',');
@ -109,9 +110,9 @@ const authenticate = async (
Username: body.username, Username: body.username,
}, },
headers: { headers: {
'x-emby-authorization': `MediaBrowser Client="Feishin", Device="${getHostname()}", DeviceId="Feishin-${getHostname()}-${encodeURIComponent( 'x-emby-authorization': `MediaBrowser Client="Feishin", Device="${getHostname()}", DeviceId="${
body.username, useAuthStore.getState().deviceId
)}", Version="${packageJson.version}"`, }", Version="${packageJson.version}"`,
}, },
}); });