Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Playlist feature: add 'Shuffle playlist' sidebar action #12498

Merged
merged 2 commits into from
Jan 3, 2024

Conversation

ronso0
Copy link
Member

@ronso0 ronso0 commented Jan 2, 2024

Closes #6988

  • shuffle the entire playlist
  • if the playlist is selected / content visible in tracks view and at least 2 tracks are selected: shuffle only selected tracks

Copy link
Member

@daschuer daschuer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, I have just left a suggestion. Please give a hint for merge.

} else {
// Create a temp model so we don't need to select the playlist
// in the persistent model in order to shuffle it
QScopedPointer<PlaylistTableModel> pPlaylistTableModel(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you consider to use unique_ptr and make_unique to get around the literal new()? You may also update other occurrences.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tbh I didn't think about it in this case. Ime my PRs sit for too long when I optimize too much en passant.
However, there are 9 occurences of this pattern in the playlist features and I can of course change them to use unique_ptr

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ups, I did not notice how that there so many occurrences. Thank you very much for fixing them all.

@ronso0
Copy link
Member Author

ronso0 commented Jan 3, 2024

Ready for merge.

Copy link
Member

@daschuer daschuer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you.

@daschuer daschuer merged commit 78ae1f6 into mixxxdj:main Jan 3, 2024
12 checks passed
@ronso0 ronso0 deleted the shuffle-playlist branch January 3, 2024 12:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Shuffle function for all playlists
2 participants