-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
playlist: fix some playlist-prev/playlist-next edge cases #14387
Conversation
Download the artifacts for this pull request: |
56fa020
to
aa0a98e
Compare
I realized that |
Previously, playlist-prev didn't work if you played a playlist to completion using --idle and tried to go back. Naturally, one would expect this to bring up the last item in the playlist, but nothing happens. This is just because playlist_get_next is stupid and doesn't take this into account since pl->current is NULL and thus returns NULL. Fix this by considering the direction, checking if the playlist was played to completion and grabbing the last entry in the index.
Similar to the previous commit but the other way around. If you start mpv as idle, load up a playlist without immediately hitting play and then try to go to the next item, nothing happens. Naturally, you would expect this to go to the first item. Fix this detecting if the playlist has not started yet, the direction, and going to the first item in the list.
aa0a98e
to
1fa03c0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make sense.
playlist-next works as expected, but playlist-prev doesn't work on idle.
edit: In my opinion, there is no difference between these two cases (both them are |
It is completely intended for playlist-prev to not work in that case. To me, your proposed behavior makes zero intuitive sense but I guess if enough people complain we can allow it. |
Previously, playlist-prev didn't work if you played a playlist to completion using --idle and tried to go back. Naturally, one would expect this to bring up the last item in the playlist, but nothing happens. This is just because playlist_get_next is stupid and doesn't take this into account since pl->current is NULL and thus returns NULL. Fix this by also considering the direction and grabbing the last playlist entry in the index.