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

[Redesign] Brand New Queuing System ✨ #484

Merged
merged 137 commits into from
Nov 21, 2023

Conversation

Chaphasilor
Copy link
Collaborator

@Chaphasilor Chaphasilor commented Aug 11, 2023

I can't believe this is finally in a state where I feel like we can think about getting this merged in.
It was an absolute pain to implement this, and I'm barely happy with the end result, but it should be (much) better than the old queueing system, both functionality and design-wise.

Here's a quick break down:

  • New QueueService for managing everything queue-related
  • Queue is split into four parts: previous tracks, current track, next up, queue
  • Support for adding tracks to "next up" (fixes [Feature Request] Add an 'Up Next' Queue #92)
    • Not affected by shuffle
  • Consistent behavior (this was the most work)
  • Quality of life improvements (show what playlists/album/etc. is currently playing = source)
  • Improved queue design, with more functionality

Screenshots

Screenshot_20230811-235039 Screenshot_20230812-000620 Screenshot_20230812-000620

TODOs

  • Fix "shuffle always starts on first song" bug
  • Remove x and 3 dots icons, make list items dismissable and add long-press handler
  • Implement collapsible previous tracks? (like in redesign mockup)
  • Support starting playback at a specific index (e.g. when tapping on a track within an album or playlist)
  • Handle more playback sources (playlists show up as albums right now)
  • Go to parent item when tapping on the source string on the player screen
  • Support adding albums/playlists/etc. to queue or next up (shuffled or original order)
  • Finish up the design (dynamic colors, background, conditional rendering)
  • Finish up playback history view (basic functionality-wise, still needs a proper design through another PR)
  • Fix like button not having the correct state
  • Replace strings with localized versions
  • Add vibro-feedback for improved UX
  • Sticky list headers?
  • Add clear button for next up list
  • Improve Playback Reporting (based on Rework player progress reporting #477)
  • Fix rewinding
  • Remove excessive debug logging and re-enable chopper logs
  • Use linear playback order for Instant Mixes (shuffle breaks song mixes, and the mix should be fully determined by Jellyfin anyway)
  • Fix label thickness
  • Reword "recently played" to "previous tracks"
  • Add "Album/Playlist/etc. added to Next Up" as source, handle it in the player header
  • Check if minBufferDuration is smaller than maxBufferDuration
    • Otherwise the app needs to continuously fetch new data
  • Re-shuffle on shuffle enable (perhaps when turning shuffle off so that at the start it isn't shuffled twice)
  • Navigate to source when clicking on "Playing from" label (not working with single-track albums?)
  • Only show artist (not album artist) in queue panel
  • Add track to history when rewinding
  • Get rid of UI glitches (noticeable re-renders, delayed scrolling, etc.)
  • Calculate accent color independent of specific screens or widgets
  • Try to fix album cover when updating the queue(s) (@jmshrv)
  • Test everything (I've been using various states of this implementation for many months now, but I'm just a single user)
  • Re-enable reordering while shuffle is active, once Reordering does not work well when combined with shuffle ryanheise/just_audio#1042 is fixed
  • Implement light mode (once designed and contrast bug has been fixed) - out of scope
  • Support playing next X songs (depending on settings) of songs tab, in current sorting order (recently added, artist, rating) - out of scope
  • Add customization options - out of scope

shoutout to @rom4nik, thanks a ton! <3

…bums

- Implemented new QueueService for handling most of the queueing logic
- Connected QueueService to MusicPlayerBackgroundTask for accessing the just_audio and audio_service queues
- Forwarded playback events from just_audio to QueueService to keep track of current item
- added new PlaybackList class for storing queue items + list meta info
- display PlaybackList info on player screen
- Refactored `QueueService` with the proper state variables and functions
- Linear & shuffled playback now working (for starting a new list, toggling doesn't work yet)
- Adding to queue works
- Manually skipping back and forth works
- Skips initiated by the player also update the internal queues of the QueueService
- there's still a bug if the player skips to the next track by itself: if 'loop all' was enabled previously but then disabled, the player will still loop once
- for more info see TODO at queue_service.dart:445
- needed to replace the concatenating audio source, because the player's index cannot be modified externally
- this results in backwards loops not being gapless, oh well...
- also fixed skipping backwards when 'loop one' is enabled (resets current track and adds entry to history)
- properly remove, prepend, and append AudioSources from/to the ConcatenatingAudioSource
- convert Streams to BehaviorSubjects
- show current track and queue (needs fixing)
- allows efficient and flexible combination of multiple lists and elements into a single scrolling view
- can skip to track in both recent track and the regular queue by tapping on them
- some inconsistencies still happen, but it mostly works
- only thing missing is disabling shuffling and keeping the right index
- fixed adjustedQueueIndex being using the track index instead of the array index
- fixed adjustedQueueIndex being based on shuffledIndices when shuffle disabled
- allows skipping using the QueueList again
@Chaphasilor
Copy link
Collaborator Author

I only wanted to improve light theme support, but ended up also redesigning the Now Playing bar 😅

(design not final)

@AhegaHOE
Copy link

Currently when the Album Artist is very long it overflows the UI.

Screenshot_20231030-165440.png

@Chaphasilor
Copy link
Collaborator Author

@AhegaHOE I just fixed all the overflow issues I could find. Let me know if I missed anything!

@AhegaHOE
Copy link

@Chaphasilor thank you. I'll take a look at it soon!

@jmshrv
Copy link
Owner

jmshrv commented Nov 21, 2023

I've discussed it with Chaphasilor, and it looks like we can finally merge this :)

@jmshrv jmshrv merged commit 5d275a2 into jmshrv:redesign Nov 21, 2023
0 of 2 checks passed
@Chaphasilor
Copy link
Collaborator Author

Holy. I thought the day would never come 😂😁

Thanks to everyone who tested and commented this! I'll try to get this to a beta level asap!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment