Commit 5192a05d authored by Francois Cartegnie's avatar Francois Cartegnie

lua intf: httprequests: fix current (fix #8314)

Compare items ID, not paths which creates duplicates
parent 2c122a47
......@@ -55,11 +55,11 @@ function print_playlist(item)
end
else
local name, path = vlc.strings.convert_xml_special_chars(item.name or "", item.path or "")
local current_item = vlc.input.item()
local current_item_id = vlc.playlist.current()
local current = ""
-- Is the item the one currently played
if(current_item ~= nil) then
if(vlc.input.item().uri(current_item) == path) then
if(current_item_id ~= nil) then
if(current_item_id == item.id) then
current = 'current="current"'
end
end
......
......@@ -334,11 +334,11 @@ parseplaylist = function (item)
local result={}
local name, path = item.name or ""
local path = item.path or ""
local current_item = vlc.input.item()
local current_item_id = vlc.playlist.current()
-- Is the item the one currently played
if(current_item ~= nil) then
if(vlc.input.item().uri(current_item) == path) then
if(current_item_id ~= nil) then
if(current_item_id == item.id) then
result.current = "current"
end
end
......
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