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

Shuffle tracks in place #1445

Open
wants to merge 7 commits into
base: dev
Choose a base branch
from

Conversation

photovoltex
Copy link
Member

Follow up on #1356 (comment)

  • removes duplication of context tracks when shuffling
  • shuffle by a given seed, by that we can restore the shuffle state after a spontaneously disconnect

With the updated protobuf definitions, there is technically a given seed from the side of spotify when transfering playback. The given seed seems to be a hex value which we can convert into a u64 (which we currently use as seed value). But the shuffled queue isn't even similar to what spotify shuffles (which makes sense as they use a more preference base algorithm with less randomness). So when transferring we reshuffle unless we have a previous shuffle seed in the context metadata.

When losing the connection and restarting the dealer, the seed is now stored in the context metadata. So on transfer we can pickup the seed again and shuffle the context as it was previously
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.

1 participant