Add an auto remove duplicates for the playlists. - #2046
Conversation
e149529 to
59ef7c8
Compare
f6bb3bd to
e526c1e
Compare
27886fc to
0861938
Compare
0861938 to
b3dee7a
Compare
24086c2 to
2458318
Compare
2458318 to
2ce7e41
Compare
bf4009f to
783eb57
Compare
e30716f to
493735e
Compare
30568cd to
3539075
Compare
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughAdds a persistent remove-duplicates playlist setting and wires it through the settings UI, playlist construction and insertion, playlist manager state, and runtime settings reload. ChangesRemove Duplicates Playlist Feature
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/core/player.cpp (1)
154-154: ⚡ Quick winUse a single source of truth for the remove-duplicates default.
Line [154] uses a literal
false; preferREMOVE_DUPLICATES_DEFAULTto prevent default drift across layers.Suggested change
- playlist_manager_->update_setting(s.value(PlaylistSettings::kRemoveDuplicates, false).toBool()); + playlist_manager_->update_setting(s.value(PlaylistSettings::kRemoveDuplicates, REMOVE_DUPLICATES_DEFAULT).toBool());🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/core/player.cpp` at line 154, The hardcoded literal `false` in the `playlist_manager_->update_setting()` call at line 154 should be replaced with the constant `REMOVE_DUPLICATES_DEFAULT` to maintain a single source of truth for the remove-duplicates default value across all layers of the codebase. This prevents default drift if the constant is updated in the future.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@src/core/player.cpp`:
- Line 154: The hardcoded literal `false` in the
`playlist_manager_->update_setting()` call at line 154 should be replaced with
the constant `REMOVE_DUPLICATES_DEFAULT` to maintain a single source of truth
for the remove-duplicates default value across all layers of the codebase. This
prevents default drift if the constant is updated in the future.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: e48fa2bd-ae4f-4f54-8324-b76af366da01
📒 Files selected for processing (9)
src/constants/playlistsettings.hsrc/core/player.cppsrc/playlist/playlist.cppsrc/playlist/playlist.hsrc/playlist/playlistmanager.cppsrc/playlist/playlistmanager.hsrc/settings/playlistsettingspage.cppsrc/settings/playlistsettingspage.uisrc/smartplaylists/smartplaylistsearchpreview.cpp
0cfbecb to
94adbbb
Compare
5125321 to
c3b13e8
Compare
e704c5c to
f973049
Compare
2ce5e0b to
7f35b4b
Compare
ca766c8 to
35fafa4
Compare
5f033b2 to
e31a931
Compare
2677525 to
2afdff9
Compare
61b3302 to
1936bf4
Compare
1936bf4 to
b88ec4c
Compare
When adding tracks to a playlist, you may have tracks in flac format for quality and mp3 format for portable devices, so when you select an album from the library to add to the playlist the flac and the mp3 will be added.
You can use the remove duplicates menu on the playlist, but if you want to have some tracks more than one time in your playlist, it will also delete theses tracks...
So I add the opportunity to automatically delete the duplicates in the added track list.
In the parameters, playlist tab, I add a checkbox to remove the added duplicates.
The data is then forwarded to the playlist object, when tracks are inserted in the playlist (Playlist::InsertSongItems), if the functionality is on, the duplicates are removed (call Playlist::RemoveDuplicateSongs)
Playlist::RemoveDuplicateSongs had been change to work on any track list, not only the playlist's tracklist.
Summary by CodeRabbit