Commit e9a77591 authored by Pierre Ynard's avatar Pierre Ynard

cli: optimize current playlist item marker

parent be8f61c0
...@@ -212,10 +212,11 @@ function playlist_is_tree( client ) ...@@ -212,10 +212,11 @@ function playlist_is_tree( client )
end end
function playlist(name,client,arg) function playlist(name,client,arg)
local current = vlc.playlist.current()
function playlist0(item,prefix) function playlist0(item,prefix)
local prefix = prefix or "" local prefix = prefix or ""
if not item.flags.disabled then if not item.flags.disabled then
local marker = ( item.id == vlc.playlist.current() ) and "*" or " " local marker = ( item.id == current ) and "*" or " "
local str = "|"..prefix..marker..tostring(item.id).." - ".. local str = "|"..prefix..marker..tostring(item.id).." - "..
( item.name or item.path ) ( item.name or item.path )
if item.duration > 0 then if item.duration > 0 then
......
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