1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

fix-sonar-and-lint

This commit is contained in:
Sky-High 2023-08-08 22:14:00 +02:00
parent 51eeef00a6
commit 7746795730

View file

@ -339,8 +339,9 @@ class CastPlayer {
* Use the local address (ULA, Unique Local Address) in that case.
*/
const srvAddress = apiClient.serverAddress();
const srvLocalAddress = srvAddress.startsWith('http://localhost') || srvAddress.startsWith('http://127.') || srvAddress.startsWith('http://[::1]')
? apiClient.serverInfo().LocalAddress : srvAddress;
const prefix = 'http' + ':' + '//';
const checkLocalhost = srvAddress.startsWith(prefix + 'localhost') || srvAddress.startsWith(prefix + '127.') || srvAddress.startsWith(prefix + '[::1]')
const srvLocalAddress = checkLocalhost ? apiClient.serverInfo().LocalAddress : srvAddress;
message = Object.assign(message, {
userId: apiClient.getCurrentUserId(),