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

Add playback order support to playback rewrite #2783

Merged
merged 1 commit into from
May 21, 2023

Conversation

nielsvanvelzen
Copy link
Member

@nielsvanvelzen nielsvanvelzen commented May 20, 2023

Changes

This change adds a new "playbackOrder" property to the playback state. The currently supported values are:

  • default - this plays back items in the default order of the queue
  • random - this plays random items, infinitely
  • shuffle - this plays items in a shuffled order, this is the same as random but every item in the queue can only be played once

Changing the order property only affects the upcoming items in a queue. This means you can play the first 3 items using default order and then switch to shuffling. The queue service keeps track of this and manages the ordering.

To implement this ordering we now need to know the size of a queue, for this a new "size" property is added to the queue interface. I've implemented this properly for the queue used by the RewriteMediaManager but the other queue implementations that aren't used yet have implementations that may not work (expose size=0 until the first getItem call which will never happen because size=0). This will be fixed later, when we start using those queues.

The current playback UI only allows switching between default & shuffle. The random option is not used.

Issues

Part of #1057

@nielsvanvelzen nielsvanvelzen added enhancement New feature or request playback Issue related to media playback labels May 20, 2023
@nielsvanvelzen nielsvanvelzen added this to the v0.16.0 milestone May 20, 2023
@neopc10
Copy link

neopc10 commented May 20, 2023

For videos can this be applied only to 'unwatched/played' items?

@nielsvanvelzen
Copy link
Member Author

For videos can this be applied only to 'unwatched/played' items?

This code has nothing to do with the watched state of items or even videos at all. This code only applies to music playback right now.

@nielsvanvelzen nielsvanvelzen marked this pull request as draft May 20, 2023 20:19
@nielsvanvelzen nielsvanvelzen marked this pull request as ready for review May 21, 2023 10:34
@nielsvanvelzen nielsvanvelzen merged commit 6af461e into jellyfin:master May 21, 2023
@nielsvanvelzen nielsvanvelzen deleted the playback-shuffle branch May 21, 2023 20:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request playback Issue related to media playback
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants