fix(Accounts): CSV imports for user playlists & "Add Album to Playlist" functions not syncing to DB

This commit is contained in:
Samidy 2026-02-08 18:34:32 +03:00
parent 61fa053fe0
commit 29dbff13b9

View file

@ -821,7 +821,7 @@ document.addEventListener('DOMContentLoaded', async () => {
await handlePublicStatus(playlist); await handlePublicStatus(playlist);
// Update DB again with isPublic flag // Update DB again with isPublic flag
await db.performTransaction('user_playlists', 'readwrite', (store) => store.put(playlist)); await db.performTransaction('user_playlists', 'readwrite', (store) => store.put(playlist));
syncManager.syncUserPlaylist(playlist, 'create'); await syncManager.syncUserPlaylist(playlist, 'create');
ui.renderLibraryPage(); ui.renderLibraryPage();
modal.classList.remove('active'); modal.classList.remove('active');
}); });
@ -1077,6 +1077,8 @@ document.addEventListener('DOMContentLoaded', async () => {
try { try {
await db.addTracksToPlaylist(playlistId, tracks); await db.addTracksToPlaylist(playlistId, tracks);
const updatedPlaylist = await db.getPlaylist(playlistId);
await syncManager.syncUserPlaylist(updatedPlaylist, 'update');
const { showNotification } = await loadDownloadsModule(); const { showNotification } = await loadDownloadsModule();
showNotification(`Added ${tracks.length} tracks to playlist.`); showNotification(`Added ${tracks.length} tracks to playlist.`);
closeModal(); closeModal();