Commit 1b455e36 authored by Ilkka Ollakka's avatar Ilkka Ollakka

lua http interface: add clumsy current-detection in playlist.xml request

Not really nice looking or anything, but I'm not that familiar with lua.
Also not sure if comparing paths/uris is the way, didn't spot any way to
get same id from both of those (or missed something trivial).
parent 9d9ffe9f
......@@ -38,7 +38,12 @@ function print_playlist(item)
print("</node>")
else
local name, path = vlc.strings.convert_xml_special_chars(item.name or "",item.path or "")
print("<leaf id='"..tostring(item.id).."' uri='"..path.."' name='"..name.."' ro='"..(item.flags.ro and "ro" or "rw").."' duration='"..tostring(item.duration).."'/>")
local currentItem = vlc.input.item().uri( vlc.input.item() )
local current = ""
if currentItem == path then
current="current='current'"
end
print("<leaf id='"..tostring(item.id).."' uri='"..path.."' name='"..name.."' ro='"..(item.flags.ro and "ro" or "rw").."' duration='"..tostring(item.duration).."' "..current.." />")
end
end
function a(t,pre)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment