fix(playlist): show correct track count when creating playlist with tracks
When creating a new playlist from a track, the sidebar was showing 0 tracks because the Qobuz API returns the playlist with tracks_count: 0 at creation time (eventual consistency). The tracks are added after, but the sidebar refresh might get stale data. - Update newPlaylist.tracks_count after adding tracks in PlaylistModal - Have handlePlaylistCreated update the sidebar with correct count - Handle both Qobuz and local track cases
This commit is contained in:
1 parent
0655888f46
commit
a276a30ff2
2 files changed
+17
-1
No files matched your search
@@ -378,6 +378,8 @@
|
||||
});
|
||||
void logPlaylistAdd(trackIds, newPlaylist.id);
|
||||
}
|
||||
// Update tracks_count to reflect added tracks (API returns 0 at creation)
|
||||
newPlaylist.tracks_count = isLocalTracks ? 0 : trackIds.length;
|
||||
}
|
||||
|
||||
onSuccess?.(newPlaylist);
|
||||
|
||||
Reference in new issue
Block a user