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

Implement queue management in RewriteMediaManager #3137

Merged
merged 2 commits into from
Oct 22, 2023

Conversation

nielsvanvelzen
Copy link
Member

So I found out that I didn't implement this yet a week ago... oops. Also found (and fixed) some bugs while working on it.

Changes

  • Support custom areItemsTheSame and areContentsTheSame functions in MutableObjectAdapter
  • Implement queue management in RewriteMediaManager
    • Adding to an existing queue will always add after the current playing item (or current if no item is playing)
    • Adding to an empty/stopped queue will play immediately
    • I deliberately did not look at the old implementation for this behavior and used what made the most sense to me
  • Optimize queue->currentAudioQueue sync
    • Use AudioQueueItem instead of BaseRowItem so the KeyProcessor shows the correct menu items for queue management
    • Simplify the mapping
    • Use custom areContentsTheSame function that always returns false to fix issue where the UI shows invalid data because the equals function in AudioQueueItem/BaseRowItem only checks the item id

Issues

!! #1057 !!

@nielsvanvelzen nielsvanvelzen added enhancement New feature or request playback Issue related to media playback labels Oct 22, 2023
@nielsvanvelzen nielsvanvelzen added this to the v0.16.0 milestone Oct 22, 2023
@@ -407,15 +407,14 @@
}

@Override
public int queueAudioItem(org.jellyfin.sdk.model.api.BaseItemDto item) {
public void queueAudioItem(org.jellyfin.sdk.model.api.BaseItemDto item) {

Check notice

Code scanning / Android Lint

Unknown nullness Note

Unknown nullability; explicitly declare as @Nullable or @NonNull to improve Kotlin interoperability; see https://developer.android.com/kotlin/interop#nullability_annotations
@nielsvanvelzen nielsvanvelzen marked this pull request as ready for review October 22, 2023 12:21
@nielsvanvelzen nielsvanvelzen merged commit f464828 into jellyfin:master Oct 22, 2023
5 checks passed
@nielsvanvelzen nielsvanvelzen deleted the playback-managed-queue branch October 22, 2023 15:12
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.

2 participants