From acf64cbc17172ce5eda00887c5a114628d4c758e Mon Sep 17 00:00:00 2001 From: Julien Maille Date: Sat, 21 Feb 2026 14:16:30 +0100 Subject: [PATCH] fix: prevent home page double refresh and improve artist name extraction in album cards --- js/qobuz-api.js | 11 ++++ js/ui.js | 143 +++++++++++++++++++++++++++--------------------- 2 files changed, 92 insertions(+), 62 deletions(-) diff --git a/js/qobuz-api.js b/js/qobuz-api.js index 6d03049..806d196 100644 --- a/js/qobuz-api.js +++ b/js/qobuz-api.js @@ -330,6 +330,17 @@ export class QobuzAPI { } } + // Similar/recommendation methods + async getSimilarArtists(artistId) { + // Qobuz doesn't have a direct similar artists endpoint in this simplified API + return []; + } + + async getSimilarAlbums(albumId) { + // Qobuz doesn't have a direct similar albums endpoint in this simplified API + return []; + } + // Unified search - search all types at once async search(query, options = {}) { const offset = options.offset || 0; diff --git a/js/ui.js b/js/ui.js index 9516dd4..38c75ce 100644 --- a/js/ui.js +++ b/js/ui.js @@ -91,6 +91,7 @@ export class UIRenderer { this.searchAbortController = null; this.vibrantColorCache = new Map(); this.visualizer = null; + this.renderLock = false; // Listen for dynamic color reset events window.addEventListener('reset-dynamic-color', () => { @@ -575,13 +576,19 @@ export class UIRenderer { else if (album.type === 'SINGLE') typeLabel = ' • Single'; const isCompact = cardSettings.isCompactAlbum(); + let artistName = ''; + if (album.artist) { + artistName = typeof album.artist === 'string' ? album.artist : album.artist.name; + } else if (album.artists?.length) { + artistName = album.artists.map((a) => a.name).join(', '); + } return this.createBaseCardHTML({ type: 'album', id: album.id, href: `/album/${album.id}`, title: `${escapeHtml(album.title)} ${explicitBadge} ${qualityBadge}`, - subtitle: `${escapeHtml(album.artist?.name ?? '')} • ${yearDisplay}${typeLabel}`, + subtitle: `${escapeHtml(artistName)} • ${yearDisplay}${typeLabel}`, imageHTML: `${escapeHtml(album.title)}`, actionButtonsHTML: `