feat(web): copy source tracks when duplicating a playlist#14321
Open
dylanjeffers wants to merge 1 commit into
Open
feat(web): copy source tracks when duplicating a playlist#14321dylanjeffers wants to merge 1 commit into
dylanjeffers wants to merge 1 commit into
Conversation
|
6116b0b to
2a42659
Compare
Promotes the duplicate-playlist flow from metadata-only to a true
duplicate that also copies every track from the source.
- New DUPLICATE_PLAYLIST action carries the source playlist id, the
composed form fields, the full source track id list, and an isAlbum
flag.
- New duplicatePlaylistSaga drives the full sequence: it dispatches the
existing createPlaylist / createAlbum saga with the first source
track as initTrackId, takes() the resulting CREATE_PLAYLIST_REQUESTED
to learn the new playlist id, then sequentially dispatches
addTrackToPlaylist({ silent: true }) for every remaining track with
a small inter-dispatch delay so each saga sees the previous
optimistic update. Closes with a single summary toast.
- DuplicatePlaylistModal now dispatches DUPLICATE_PLAYLIST and exposes
the actual track count to the user ("All N tracks will be copied")
instead of the previous "tracks not copied" note.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
12936a4 to
24e8a3b
Compare
Contributor
🌐 Web preview readyPreview URL: https://audius-web-preview-pr-14321.audius.workers.dev Unique preview for this PR (deployed from this branch). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Promotes the duplicate-playlist flow (#14319) from metadata-only to a true duplicate that also copies every track from the source playlist.
Stacked on #14320 → #14319 → #14318.
Implementation
DUPLICATE_PLAYLISTaction (incacheCollectionsActions) carries{ sourcePlaylistId, formFields, trackIds, source, isAlbum }.duplicatePlaylistSagaorchestrates the full sequence:createPlaylist/createAlbumaction withinitTrackId = trackIds[0]so the first track lands as part of the create flow.take()s the resultingCREATE_PLAYLIST_REQUESTEDto learn the new playlist id.addTrackToPlaylist(trackId, newPlaylistId, { silent: true })with a 30 ms inter-dispatch delay so each saga's optimistic update is visible to the next iteration.DuplicatePlaylistModalnow dispatchesDUPLICATE_PLAYLISTand surfaces the actual track count to the user ("All N tracks will be copied to the new playlist") instead of the previous "tracks not copied" note.Test plan
🤖 Generated with Claude Code