]> git.sesse.net Git - vlc/commitdiff
lua intf: httprequests: fix current (fix #8314)
authorFrancois Cartegnie <fcvlcdev@free.fr>
Sat, 13 Apr 2013 13:04:15 +0000 (15:04 +0200)
committerFrancois Cartegnie <fcvlcdev@free.fr>
Sat, 13 Apr 2013 13:52:46 +0000 (15:52 +0200)
Compare items ID, not paths which creates duplicates

share/lua/http/requests/playlist_jstree.xml
share/lua/intf/modules/httprequests.lua

index d8bbe02eb2f7d825db1ac8c808abd3e7b5831549..bda87d61a1d285715af3ff400e2cfc1faabefde1 100644 (file)
@@ -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
@@ -82,4 +82,4 @@ end
 --a(p) --Uncomment to debug
 print_playlist(p)
 ?>
-</root>
\ No newline at end of file
+</root>
index d512227073bc71ac278ed8050ce8c41bc60ce4d5..e387d9b9747ca3d7f10272de0b6ba0250714f273 100644 (file)
@@ -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