From acb15d8c0015618699815ae873de87b3ee2852e2 Mon Sep 17 00:00:00 2001 From: Honey Date: Sun, 7 Jun 2026 14:05:10 +0200 Subject: [PATCH] fix: hero card shows romaji for album name and artist loadHeroCard() now pre-fetches the romaji index (same pattern as loadAlbumRow) and uses dispAlbumName()/dispArtistById() instead of raw album.name/artist. Co-Authored-By: Claude Sonnet 4.6 --- src/views/home.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/views/home.js b/src/views/home.js index 6f15b38..a539e4b 100644 --- a/src/views/home.js +++ b/src/views/home.js @@ -1,6 +1,6 @@ import { S } from '../state.js'; import { esc } from '../utils.js'; -import { api, apiCached, apiIsCached, coverUrl, fetchRomajiIndex, dispArtistById } from '../api.js'; +import { api, apiCached, apiIsCached, coverUrl, fetchRomajiIndex, dispArtistById, dispAlbumName } from '../api.js'; import { makeCard, makeAlbumCard, makeSongItem } from '../ui/components.js'; import { playQueue } from '../player/player.js'; // Circular — safe (called inside event handlers) @@ -42,6 +42,7 @@ async function loadHeroCard() { const [freqRes, recRes] = await Promise.allSettled([ api('getAlbumList2', '&type=frequent&size=5'), api('getAlbumList2', '&type=recent&size=5'), + S.cfg.showRomaji ? fetchRomajiIndex().catch(() => {}) : Promise.resolve(), ]); const freqList = freqRes.status === 'fulfilled' ? (freqRes.value.albumList2?.album || []) : []; const recList = recRes.status === 'fulfilled' ? (recRes.value.albumList2?.album || []) : []; @@ -59,8 +60,8 @@ async function loadHeroCard() { ${thumbUrl ? `${esc(album.name)}` : ''}
${heroLabel}
-
${esc(album.name)}
-
${esc(album.artist || '')}
+
${esc(dispAlbumName(album.name))}
+
${esc(dispArtistById(album.artistId, album.artist || ''))}