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

Fix shuffle history #4255

Merged
merged 5 commits into from Jan 23, 2023
Merged

Fix shuffle history #4255

merged 5 commits into from Jan 23, 2023

Conversation

slosd
Copy link
Contributor

@slosd slosd commented Jan 14, 2023

Check-list

  • There is a linked issue discussing the motivations for this feature or bugfix
  • Unit tests have been added where possible
  • I've added / updated documentation for any user-facing features.
  • Performance seems to be comparable or better than current main

What this change is adding / fixing

Reset play order in queue for new set of songs

Used a specialized QueueModel because the test test_random_queue_666 requires behavior that's slightly different from PlaylistModel.

Preserve shuffle history when songlist is reordered

Reorder songlist in place

Instead of replacing the whole list reorder the existing one. This
allows play order implementations to continue to use any saved
TreeIters.

Fixes #4108

Revert "Ignore auto_sort when shuffle is enabled (#3581)"

This reverts commit 68ba678. This limitation shouldn't be necessary anymore.

@declension
Copy link
Member

Side note: I guess we do need a strong "songlike type" than Any. AudioFile is good if it's actually that, but sometimes it's a string so a few times I've added a union but, I dunno maybe it's not worth it.

@declension
Copy link
Member

(I think the Windows job is failing because of a different version of mypy, despite efforts to unify these...

anyway it just wants an annotation on found = [])

@declension declension self-requested a review January 22, 2023 12:54
Copy link
Member

@declension declension left a comment

Choose a reason for hiding this comment

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

LGTM

quodlibet/order/__init__.py Show resolved Hide resolved
quodlibet/qltk/queue.py Outdated Show resolved Hide resolved
quodlibet/order/__init__.py Show resolved Hide resolved
tests/test_qltk_songmodel.py Show resolved Hide resolved
tests/test_qltk_songmodel.py Outdated Show resolved Hide resolved
Instead of replacing the whole list reorder the existing one. This
allows play order implementations to continue to use any saved
TreeIters.

Fixes quodlibet#4108
@declension declension merged commit 500d0d1 into quodlibet:main Jan 23, 2023
@declension
Copy link
Member

Thanks @slosd !

declension added a commit that referenced this pull request Sep 27, 2023
declension added a commit that referenced this pull request Sep 27, 2023
@slosd slosd mentioned this pull request Oct 22, 2023
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Shuffle mode loses played-history when song list is reordered
2 participants