diff --git a/src/api.js b/src/api.js index cd9a51e..9593111 100644 --- a/src/api.js +++ b/src/api.js @@ -133,10 +133,12 @@ export async function ensureArtistSortMap() { _artistSortFetch = apiCached('getArtists') .then(r => { const all = (r?.artists?.index || []).flatMap(i => i.artist || []); + console.log('[sort-debug] getArtists sample (first 3):', all.slice(0,3).map(a => ({ id: a.id, name: a.name, sortName: a.sortName }))); cacheArtistSortNames(all); + console.log('[sort-debug] _artistSortMap size:', _artistSortMap?.size); _artistSortFetch = null; }) - .catch(() => { _artistSortFetch = null; }); + .catch(e => { console.warn('[sort-debug] ensureArtistSortMap error:', e); _artistSortFetch = null; }); return _artistSortFetch; } diff --git a/src/views/detail.js b/src/views/detail.js index a2b55cd..e89e235 100644 --- a/src/views/detail.js +++ b/src/views/detail.js @@ -396,6 +396,8 @@ export async function loadAlbumDetail(album) { const songs = r.album?.song || []; const totalMin = Math.round(songs.reduce((s,t) => s+(t.duration||0), 0) / 60); document.getElementById('album-detail-stats').textContent = `${songs.length} Titel · ${r.album.year||''} · ${totalMin} Min.`; + console.log('[sort-debug] r.album full:', JSON.stringify(r.album)); + if (songs[0]) console.log('[sort-debug] songs[0] full:', JSON.stringify(songs[0])); // r.album has sortName (album sort tag) — use it; nav album may not have sortName document.getElementById('album-detail-name').textContent = dispAlbumName(r.album); if (songs[0]) {