mirror of
https://github.com/informaticker/discord-jellyfin-bot.git
synced 2024-11-24 18:41:57 +01:00
Don't overwrite base path when constructing paths (#240)
* Don't overwrite base path for WebSockets * Take base path into account while constructing stream URL
This commit is contained in:
parent
b3908a4130
commit
18af088774
@ -18,7 +18,7 @@ export class JellyfinStreamBuilderService {
|
||||
const accessToken = this.jellyfinService.getApi().accessToken;
|
||||
|
||||
const uri = new URL(api.basePath);
|
||||
uri.pathname = `/Audio/${jellyfinItemId}/universal`;
|
||||
uri.pathname += `/Audio/${jellyfinItemId}/universal`;
|
||||
uri.searchParams.set('UserId', this.jellyfinService.getUserId());
|
||||
uri.searchParams.set(
|
||||
'DeviceId',
|
||||
|
@ -154,7 +154,7 @@ export class JellyfinWebSocketService implements OnModuleDestroy {
|
||||
|
||||
private buildSocketUrl(baseName: string, apiToken: string, device: string) {
|
||||
const url = new URL(baseName);
|
||||
url.pathname = '/socket';
|
||||
url.pathname += '/socket';
|
||||
url.protocol = url.protocol.replace('http', 'ws');
|
||||
url.search = `?api_key=${apiToken}&deviceId=${device}`;
|
||||
return url;
|
||||
|
Loading…
Reference in New Issue
Block a user