fix(plex_connect): refactor shuffle to be more consistent#2985
fix(plex_connect): refactor shuffle to be more consistent#2985LeMyst wants to merge 1 commit intomusic-assistant:devfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This pull request refactors shuffle and seek option handling in the Plex Connect player integration to ensure consistent application across different playback scenarios and prevent redundant shuffling when Plex has already managed it server-side.
Changes:
- Adds shuffle and seek application immediately after playback starts for fallback, regular container, and single item scenarios
- Explicitly disables shuffle in
fetch_queueandcreate_queuemethods when PlayQueues are already ordered/shuffled by Plex server
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
48f710d to
b75f16d
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
b75f16d to
452a433
Compare
|
Hello @LeMyst , it looks good. However, I have a bunch of manual tests I usually run to see if everything works. Let me come back to you in a few days with the result of my tests. |
If possible, we could maybe add those tests as unit tests in another PR? |
|
Also lint, mypy and conflicts to be resolved. Marking as draft until this is ready. |
|
My tests are difficult to integrate in unit tests I'm afraid. I usually start playback and try multiple corner cases. Once I have time I will document those tests for others! All seems well for this PR on my side @LeMyst ! |
Thanks for the sanity check. @LeMyst , if you could fix the tests, mark this as 'ready for review' then this should be food to merge :) |
Shuffle and seek operations are now consistently applied after playback for fallback, regular containers, and single items. Shuffle is explicitly disabled when Plex has already handled queue ordering/shuffling server-side to prevent double randomization.
452a433 to
5d8fc43
Compare
This pull request refactors how shuffle and seek options are handled when playing media through the Plex Connect player remote integration. The main goal is to ensure shuffle and seek are consistently applied to playback, while preventing redundant shuffling when Plex has already handled it server-side.
Playback option handling improvements:
handle_play_media, ensuring consistent behavior across all playback types. [1] [2] [3]Prevention of redundant shuffle:
fetch_queueandcreate_queue, shuffle is explicitly disabled (set_shuffle(player_id, False)) when the PlayQueue is already ordered or shuffled by Plex, avoiding double randomization of the queue. [1] [2]