Skip to content

Show "play next" option when song is already in queue#2327

Open
G1org1owo wants to merge 5 commits intoKRTirtho:masterfrom
G1org1owo:master
Open

Show "play next" option when song is already in queue#2327
G1org1owo wants to merge 5 commits intoKRTirtho:masterfrom
G1org1owo:master

Conversation

@G1org1owo
Copy link

Addresses #2325
Partially addresses #2088, #1721

Allows users to "Play next" a song which is already present in queue. This is currently not possible and makes the intended use flow quite confusing.

This is a quick fix adhering to the current system, but I believe the whole queue/play next system should be revised as suggested in #2217.

@KRTirtho
Copy link
Owner

Actually just adding back the option wouldn't work that way. You also have to handle the case differently for tracks already in queue.
In the callback for playNext, for tracks already in queue, audioPlayer.move must be used instead of addTrackAt

@KRTirtho KRTirtho self-requested a review November 17, 2025 03:53
Copy link
Owner

@KRTirtho KRTirtho left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please resolve the conflicts

@G1org1owo
Copy link
Author

G1org1owo commented Nov 18, 2025

Actually just adding back the option wouldn't work that way. You also have to handle the case differently for tracks already in queue. In the callback for playNext, for tracks already in queue, audioPlayer.move must be used instead of addTrackAt

After taking a quick look at the codebase, I assumed that by "the callback for playNext" you meant the switch case in TrackOptionsAction, but I wasn't sure how to discern whether or not a track was in the queue from there. So I decided to change AudioPlayerNotifier::addTracksAtFirst in a way that instead of filtering out duplicated tracks when allowDuplicates is false, they get moved to the top. I might now have realized a semi-decent way to do it outside of this method so tell me if I need to rewrite this.

I couldn't get flutter to build on windows so I'll try and build this tomorrow on my laptop, provided I can actually get around to downloading the sdk somewhat rapidly. I'll request a new review once I'm confident it doesn't just crash horribly.

@G1org1owo
Copy link
Author

Asking a new review as this now builds and seems to work as intended. If I tried to manually update the state as was being done before, I got inconsistencies between the view and the underlying playlist, while by removing it altogether I could get the desired effect, but I couldn't understand if it was being updated in some other place. Is there a reason for this/was it unnecessary?

@G1org1owo G1org1owo requested a review from KRTirtho November 19, 2025 12:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants