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 <noreply@anthropic.com>
This commit is contained in:
HoneyandClaude Sonnet 4.6 committed 2026-05-23 22:50:22 +02:00
1 parent c6990cfd7b
commit 11a31f85aa
1 file changed
+7
+7
View File
@@ -281,6 +281,13 @@ export async function showSongInfo(s) {
const r = await api('getSong', `&id=${s.id}`); const r = await api('getSong', `&id=${s.id}`);
const full = r.song; const full = r.song;
if (full) { 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; S.infoSong = full;
_renderInfoModal(full); _renderInfoModal(full);
// If edit mode was already opened before getSong returned, refresh the fields // If edit mode was already opened before getSong returned, refresh the fields