Image 01
profile-image

midnorton

Quick Save/Load Playlist

VLC Extensions

by Xrott
Score 52%
52 Likes
48 Dislikes
Aug 25 2018
I just modified the trigger function.


function trigger()
local dirSep = package.config:sub(1,1)
local saveFile = vlc.config.userdatadir() .. dirSep .. "quicksave.sav"

local plRaw, pl = vlc.playlist.get("normal").children, {}

if table.getn(plRaw) > 0 then
vlc.msg.info("Saving playlist to '" .. saveFile .. "' ...")

local file, err = io.open(saveFile, "w+")
if not file then error(err) end

for i, v in ipairs(plRaw) do pl[tostring(i)] = v end -- converting numerical to string keys to preserve the order

local sTable = serialize(pl)

local success, err = file:write(sTable)
if not success then error(err) end

file:close()

vlc.msg.info("Playlist saved as '" .. saveFile .. "'!")
end
end
- Aug 21 2018
I have made a small change to prevent quickSave saving a zero length Playlist. The Apple Magic mouse can be a little twitchy and once or twice I have hit "Save" as I was trying to "Load". If it would be of interest I can upload it if I could work out how. - Aug 21 2018
Quick Save/Load Playlist

VLC Extensions

by Xrott
Score 52%
52 Likes
48 Dislikes
Aug 21 2018