How to change the ordering of a playlist via HTTP interface?

Microsoft Windows specific usage questions
Forum rules
Please post only Windows specific questions in this forum category. If you don't know where to post, please read the different forums' rules. Thanks.
hedgehog90
Blank Cone
Blank Cone
Posts: 12
Joined: 16 Nov 2018 13:04

How to change the ordering of a playlist via HTTP interface?

Postby hedgehog90 » 02 Mar 2020 22:59

I can find nowhere in the documentation how to move an existing playlist item in the playlist order.
I can do everything else it seems, but mysteriously this simple command appears to be missing...

How do I change the order of one or more playlist items in a single command?

EDIT:

I found all the commands handled by the http interface listed in the source file modules/lua/libs/playlist.c, and at the end of that list is a command called 'move' (vlc.playlist.move), linked to a function named vlclua_playlist_move.

Unfortunately in httprequests.luac, the move command appears to be the only command not registered.

However, if I decompile httprequests.luac and edit it, adding the following lines to the processcommands function:

Code: Select all

elseif command == "pl_move" then vlc.playlist.move(tonumber(_GET['from']),tonumber(_GET['to']))
then I can get it to move playlist items via the http interface.

the command pl_move positions the id 'from' infront of 'to'. If you need to position 'from' as the first item of the playlist, you have to set 'to' to 1, which refers to the playlist node itself...
Although it works functionally, the playlist in the GUI doesn't update to reflect the changes and so it jumps around quite the playlist from item to item. Strange!

If someone could flag this issue with the developers - the lack of a pl_move command in the httprequests.lua and the playlist not updating - I'd be grateful.

jackspm
Blank Cone
Blank Cone
Posts: 14
Joined: 10 Apr 2020 00:05

Re: How to change the ordering of a playlist via HTTP interface?

Postby jackspm » 19 Nov 2020 07:45

I was experimenting this 'playlist move' function as well and I can confirmed your findings. Although I was able to get the function to work, the function itself is a bit buggy. Sometimes, it doesn't do anything (no move at all). Sometimes, it doesn't move correctly (wrong location). Sometimes it may even crash the player. This bug seems to appear over 4 years ago (https://trac.videolan.org/vlc/ticket/17048). Good news is that it has finally been fixed.


Return to “VLC media player for Windows Troubleshooting”

Who is online

Users browsing this forum: No registered users and 34 guests