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 UI audio queue order when shuffling #4322

Merged

Conversation

nielsvanvelzen
Copy link
Member

When shuffling the queue stays the same data structure and the playback order is used to return items based on the shuffled indices. The updateAdapter function used the internal list of the queue supplier so playback ordering was never used, causing the wrong items to display during shuffle.

Changes

  • Use the actual queue to provide items instead, limited to the next 100 items (including current)
  • Refresh adapter when playback order changes
  • Compare items by id (performance gain)

Issues

@nielsvanvelzen nielsvanvelzen added the bug Something isn't working label Dec 20, 2024
@nielsvanvelzen nielsvanvelzen added this to the v0.18.3 milestone Dec 20, 2024
@BotBlake
Copy link
Member

I love you Niels 🗿 🫶

playing = true
}
// It's safe to run this blocking as all items are prefetched via the [BaseItemQueueSupplier]
val upcomingItems = runBlocking { playbackManager.queue.peekNext(100) }

Check warning

Code scanning / detekt

Report magic numbers. Magic number is a numeric literal that is not defined as a constant and hence it's unclear what the purpose of this number is. It's better to declare such numbers as constants and give them a proper name. By default, -1, 0, 1, and 2 are not considered to be magic numbers. Warning

This expression contains a magic number. Consider defining it to a well named constant.
@nielsvanvelzen nielsvanvelzen merged commit e87e96e into jellyfin:master Dec 21, 2024
5 checks passed
@nielsvanvelzen nielsvanvelzen deleted the rmm-adapter-wrong-shuffle branch December 24, 2024 12:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants