Fix public user playlist 404 error on download and play

This commit is contained in:
Julien Maille 2026-01-08 18:11:48 +01:00
parent 89b8e7e24b
commit d74eca943c
2 changed files with 19 additions and 4 deletions

View file

@ -301,10 +301,18 @@ document.addEventListener('DOMContentLoaded', async () => {
try {
let playlist, tracks;
const userPlaylist = await db.getPlaylist(playlistId);
let userPlaylist = await db.getPlaylist(playlistId);
if (!userPlaylist) {
try {
userPlaylist = await syncManager.getPublicPlaylist(playlistId);
} catch (e) {
// Not a public playlist
}
}
if (userPlaylist) {
playlist = { ...userPlaylist, title: userPlaylist.name };
playlist = { ...userPlaylist, title: userPlaylist.name || userPlaylist.title };
tracks = userPlaylist.tracks || [];
} else {
const data = await api.getPlaylist(playlistId);

View file

@ -399,8 +399,15 @@ export async function handleTrackAction(action, item, player, api, lyricsManager
const data = await api.getPlaylist(item.uuid);
tracks = data.tracks;
} else if (type === 'user-playlist') {
const playlist = await db.getPlaylist(item.id);
tracks = playlist ? playlist.tracks : [];
let playlist = await db.getPlaylist(item.id);
if (!playlist) {
try {
playlist = await syncManager.getPublicPlaylist(item.id);
} catch (e) {
// Ignore
}
}
tracks = playlist ? playlist.tracks : (item.tracks || []);
}
if (tracks.length > 0) {