vixalien / muzika

Elegant music streaming app
GNU General Public License v3.0
268 stars 17 forks source link

Player Improvements #151

Closed vixalien closed 4 months ago

vixalien commented 4 months ago

Better code patterns and some fixing of the way the player handles next tracks, etc..

TODO:

vixalien commented 4 months ago

This PR doesn't have much release notes except that it fixes much of my gripes with the player.

Not everything is fixed but hopefully we'll get there someday

gregthwuen commented 4 months ago

The issues I previously had with playback seem to be fixed, awesome!

One (new?) bug: When closing the app in the middle of a song, it will (correctly) remember its progress. But then choosing a new song, it will start playing at this position even if it's not the same title. If the new title is shorter than the position the previous title was stopped at, it will just skip to the next song in the queue.

This does not occur when keeping the app open or in the background, though.

Besides this bug, I'm unsure if retaining playback progress throughout a restart really is desired or expected behavior, since not even the YT Music Android app (or generally most music players) do this.

gregthwuen commented 4 months ago

Another regression compared to current main (9750b6c):

When first opening this version (after installing or after upgrading), most list views stay empty, persisting throughout restarts or logging in. This is only fixed by starting to play any song. Afterward any newly loaded list views are displayed correctly, also throughout restarts.

This behavior is consistent throughout different content types, but not different view types (I hope you know what I mean with that). Here's a quickly compiled list:

I'm attaching two screenshots demonstrating this behavior.

Screenshot from 2024-05-18 00-33-55 Screenshot from 2024-05-18 01-24-43

vixalien commented 4 months ago

Another regression compared to current main (https://github.com/vixalien/muzika/commit/9750b6cd7bee23c055a84b44da918eeb28ecfb6b)

I have not figured out these issues yet, but they are likely a result of me correctly using queues vs player. The queue is the only one that clients should listen to for when the current track changes, but we have incorrectly been using the player's state.

Because the queue's state and the player's state can sometimes get out of sync, for example when loading a track takes a long time, the queue will update but the player will show the old track as still playing. I'm planning to address this soon.

vixalien commented 4 months ago

But then choosing a new song, it will start playing at this position even if it's not the same title.

Oops, turns out I already had a fix commit but forgot to push it here.

I'm unsure if retaining playback progress throughout a restart really is desired or expected behavior, since not even the YT Music Android app (or generally most music players) do this.

You're correct. I will drop this.

vixalien commented 4 months ago

I'm attaching two screenshots demonstrating this behavior

You can check to see if this (and any other issues) are fixed. This version of Muzika should be much more consistent in playback