[vlc-commits] lua intf: httprequests: fix current (fix #8314)

Francois Cartegnie git at videolan.org
Sat Apr 13 15:54:05 CEST 2013


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Sat Apr 13 15:04:15 2013 +0200| [5192a05dbb57338f9633b39a32309f6421f33a0e] | committer: Francois Cartegnie

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

Compare items ID, not paths which creates duplicates

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=5192a05dbb57338f9633b39a32309f6421f33a0e
---

 share/lua/http/requests/playlist_jstree.xml |    8 ++++----
 share/lua/intf/modules/httprequests.lua     |    6 +++---
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/share/lua/http/requests/playlist_jstree.xml b/share/lua/http/requests/playlist_jstree.xml
index d8bbe02..bda87d6 100644
--- a/share/lua/http/requests/playlist_jstree.xml
+++ b/share/lua/http/requests/playlist_jstree.xml
@@ -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>
diff --git a/share/lua/intf/modules/httprequests.lua b/share/lua/intf/modules/httprequests.lua
index d512227..e387d9b 100644
--- a/share/lua/intf/modules/httprequests.lua
+++ b/share/lua/intf/modules/httprequests.lua
@@ -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



More information about the vlc-commits mailing list