From 11a31f85aafd2e26570f1a9efecec6ffd3c9587b Mon Sep 17 00:00:00 2001 From: Honey Date: Sat, 23 May 2026 22:50:22 +0200 Subject: [PATCH] fix: populate albumArtist in metadata editor via getAlbum fallback getSong often omits albumArtist; getAlbum always returns album.artist. Enrich the song object before showing the edit form. Co-Authored-By: Claude Sonnet 4.6 --- src/ui.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/ui.js b/src/ui.js index aa711be..8f426d1 100644 --- a/src/ui.js +++ b/src/ui.js @@ -281,6 +281,13 @@ export async function showSongInfo(s) { const r = await api('getSong', `&id=${s.id}`); const full = r.song; if (full) { + // getSong often omits albumArtist — fill it from getAlbum which always has album.artist + if (!full.albumArtist && full.albumId) { + try { + const ar = await api('getAlbum', `&id=${full.albumId}`); + if (ar.album?.artist) full.albumArtist = ar.album.artist; + } catch {} + } S.infoSong = full; _renderInfoModal(full); // If edit mode was already opened before getSong returned, refresh the fields