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

satisfy eslint

This commit is contained in:
Sky-High 2023-09-10 21:16:40 +02:00
parent 61a6d6e8f0
commit 70c1b5b6e4

View file

@ -337,6 +337,7 @@ class CastPlayer {
* Use the local address (ULA, Unique Local Address) in that case.
*/
const serverAddress = apiClient.serverAddress();
// eslint-disable-next-line compat/compat
const hostname = (new URL(serverAddress)).hostname;
const isLocalhost = hostname === 'localhost' || hostname.startsWith('127.') || hostname === '[::1]';
const serverLocalAddress = isLocalhost ? apiClient.serverInfo().LocalAddress : serverAddress;