fix(android): persist artists array in localStorage so multi-artist splits survive cold start

The queue serialization was saving artist as a plain string but not the
artists array. On cold start the app restores from localStorage, so
parseArtists had no array to work with and fell back to splitting the
artist string by semicolons — "Maduk Veela" has none, so it returned
one combined entry. PWA always re-fetches fresh API data so the array
was always present. Adding artists:[] to both song and queue entries
fixes artist navigation after cold start on Android.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
HoneyandClaude Sonnet 4.6 committed 2026-06-08 20:31:08 +02:00
1 parent 60e89fe3b6
commit 1f9495f806
1 file changed
+4 -2
+4 -2
View File
@@ -483,10 +483,12 @@ export function updatePlayerUI(s, _skipMediaSession = false) {
try {
localStorage.setItem('ns_last_played', JSON.stringify({
song: { id:s.id, title:s.title, artist:s.artist, album:s.album, albumId:s.albumId,
artistId:s.artistId, coverArt:s.coverArt, duration:s.duration, _starred:s._starred||false },
artistId:s.artistId, coverArt:s.coverArt, duration:s.duration, _starred:s._starred||false,
artists:s.artists||[] },
queue: S.queue.map(t => ({ id:t.id, title:t.title, artist:t.artist, album:t.album,
albumId:t.albumId, artistId:t.artistId, coverArt:t.coverArt,
duration:t.duration, _starred:t._starred||false })),
duration:t.duration, _starred:t._starred||false,
artists:t.artists||[] })),
qIdx: S.qIdx,
}));
} catch {}