Encode credential for subsonic stream/coverart (#841)
Some checks failed
Test / release (macos-latest) (push) Has been cancelled
Test / release (ubuntu-latest) (push) Has been cancelled
Test / release (windows-latest) (push) Has been cancelled

This commit is contained in:
jeffvli 2024-11-13 17:54:54 -08:00
parent 21f4a78dd7
commit 8ec4551b46

View File

@ -24,14 +24,15 @@ const getCoverArtUrl = (args: {
return null; return null;
} }
return ( const url =
`${args.baseUrl}/rest/getCoverArt.view` + `${args.baseUrl}/rest/getCoverArt.view` +
`?id=${args.coverArtId}` + `?id=${args.coverArtId}` +
`&${args.credential}` + `&${encodeURIComponent(args.credential || '')}` +
'&v=1.13.0' + '&v=1.13.0' +
'&c=feishin' + '&c=feishin' +
`&size=${size}` `&size=${size}`;
);
return url;
}; };
const normalizeSong = ( const normalizeSong = (
@ -48,7 +49,7 @@ const normalizeSong = (
size: size || 300, size: size || 300,
}) || null; }) || null;
const streamUrl = `${server?.url}/rest/stream.view?id=${item.id}&v=1.13.0&c=feishin_${deviceId}&${server?.credential}`; const streamUrl = `${server?.url}/rest/stream.view?id=${item.id}&v=1.13.0&c=feishin_${deviceId}&${encodeURIComponent(server?.credential || '')}`;
return { return {
album: item.album || '', album: item.album || '',