Skip to content

select.lua: update the playlist submenu after playlist-move#17336

Merged
kasper93 merged 1 commit intompv-player:masterfrom
guidocella:playlist-move-fix
Jan 28, 2026
Merged

select.lua: update the playlist submenu after playlist-move#17336
kasper93 merged 1 commit intompv-player:masterfrom
guidocella:playlist-move-fix

Conversation

@guidocella
Copy link
Copy Markdown
Contributor

@guidocella guidocella commented Jan 26, 2026

Observing playlist-pos and playlist-count is not enough to update it after playlist-move, but we can observe any playlist property with type none to get notified of every MP_EVENT_CHANGE_PLAYLIST, even if the property has not changed.

This is similar to the mp.observe_property("vsync-jitter", "none", recorder) hack used by stats.lua to replicate the deprecated tick event.

Fixes #16816 (comment)

@guidocella guidocella force-pushed the playlist-move-fix branch 2 times, most recently from e3f2299 to 7b36d8e Compare January 26, 2026 14:29
@guidocella
Copy link
Copy Markdown
Contributor Author

The only downside of this is that it updates menu-data 3 times when changing playlist position.

Comment thread player/lua/select.lua Outdated
Comment thread player/lua/select.lua Outdated
Comment thread player/lua/select.lua Outdated
Comment thread player/lua/select.lua Outdated
Observing playlist-pos and playlist-count is not enough to update it
after playlist-move, but we can observe any playlist property with type
none to get notified of every MP_EVENT_CHANGE_PLAYLIST, even if the
property has not changed.

This is similar to the
mp.observe_property("vsync-jitter", "none", recorder) hack used by
stats.lua to replicate the deprecated tick event.

Fixes mpv-player#16816 (comment)
Copy link
Copy Markdown
Member

@kasper93 kasper93 left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@kasper93 kasper93 merged commit d79172a into mpv-player:master Jan 28, 2026
29 checks passed
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