From 17e343069174446c38f59b16745216b45e2f3ae2 Mon Sep 17 00:00:00 2001 From: binimum <61615730+binimum@users.noreply.github.com> Date: Sun, 5 Apr 2026 15:23:38 +0000 Subject: [PATCH] style: auto-fix linting issues --- js/api.js | 9 ++++++--- js/player.js | 3 +-- js/ui.js | 30 +++++++++++++++++++++++------- 3 files changed, 30 insertions(+), 12 deletions(-) diff --git a/js/api.js b/js/api.js index cf8bc17..5808a83 100644 --- a/js/api.js +++ b/js/api.js @@ -1953,10 +1953,13 @@ export class LosslessAPI { } getCoverSrcset(id) { - if (!id || (typeof id === 'string' && (id.startsWith('http') || id.startsWith('blob:') || id.startsWith('assets/')))) { + if ( + !id || + (typeof id === 'string' && (id.startsWith('http') || id.startsWith('blob:') || id.startsWith('assets/'))) + ) { return ''; } - + const formattedId = String(id).replace(/-/g, '/'); const baseUrl = `https://resources.tidal.com/images/${formattedId}`; return `${baseUrl}/160x160.jpg 160w, ${baseUrl}/320x320.jpg 320w, ${baseUrl}/640x640.jpg 640w`; @@ -1979,7 +1982,7 @@ export class LosslessAPI { if (!id || (typeof id === 'string' && (id.startsWith('blob:') || id.startsWith('assets/')))) { return ''; } - + const formattedId = String(id).replace(/-/g, '/'); const baseUrl = `https://resources.tidal.com/images/${formattedId}`; return `${baseUrl}/160x160.jpg 160w, ${baseUrl}/320x320.jpg 320w, ${baseUrl}/640x640.jpg 640w`; diff --git a/js/player.js b/js/player.js index 3f4032a..4e96a89 100644 --- a/js/player.js +++ b/js/player.js @@ -308,8 +308,7 @@ export class Player { if (coverEl) { const videoCoverUrl = track.videoUrl || track.videoCoverUrl || track.album?.videoCoverUrl || null; const coverId = track.image || track.cover || track.album?.cover; - const coverUrl = - videoCoverUrl || this.api.getCoverUrl(coverId); + const coverUrl = videoCoverUrl || this.api.getCoverUrl(coverId); const coverSrcset = videoCoverUrl ? null : this.api.getCoverSrcset(coverId); if (videoCoverUrl) { diff --git a/js/ui.js b/js/ui.js index 9ea45bf..1ce688b 100644 --- a/js/ui.js +++ b/js/ui.js @@ -543,27 +543,43 @@ export class UIRenderer { `; } - getCoverHTML(cover, alt, className = 'card-image', loading = 'lazy', videoCoverUrl = null, isEditorsPick = false, type = 'album') { + getCoverHTML( + cover, + alt, + className = 'card-image', + loading = 'lazy', + videoCoverUrl = null, + isEditorsPick = false, + type = 'album' + ) { let size = '320'; if (this.currentPage === 'search' || className === 'track-item-cover') { size = '80'; } else if (type === 'artist') { size = '160'; } - - const imageUrl = type === 'artist' ? this.api.getArtistPictureUrl(cover, size) : this.api.getCoverUrl(cover, size); - + + const imageUrl = + type === 'artist' ? this.api.getArtistPictureUrl(cover, size) : this.api.getCoverUrl(cover, size); + if (videoCoverUrl) { return ``; } - - if (isEditorsPick && cover && typeof cover === 'string' && !cover.startsWith('http') && !cover.startsWith('blob:') && !cover.startsWith('assets/')) { + + if ( + isEditorsPick && + cover && + typeof cover === 'string' && + !cover.startsWith('http') && + !cover.startsWith('blob:') && + !cover.startsWith('assets/') + ) { const formattedId = String(cover).replace(/-/g, '/'); const tidalUrl = `https://resources.tidal.com/images/${formattedId}/320x320.jpg`; const wsrvUrl = `https://wsrv.nl/?url=${encodeURIComponent(tidalUrl)}&w=250&h=250&output=webp`; return `${alt}`; } - + return `${alt}`; }