[vlc-commits] lua/http: fix stray use of renamed current_id variable

Pierre Ynard git at videolan.org
Fri Aug 7 19:32:51 CEST 2020


vlc/vlc-3.0 | branch: master | Pierre Ynard <linkfanel at yahoo.fr> | Fri Aug  7 19:14:09 2020 +0200| [d7840bfdbc7503be74e42aebf698f347c70750fa] | committer: Pierre Ynard

lua/http: fix stray use of renamed current_id variable

This prevented the play button from working if no playlist item was
selected.

Fixes #4516

(cherry picked from commit 9b167d9a8bf293a1d3612b1ad80f352d998e41ad)
Signed-off-by: Pierre Ynard <linkfanel at yahoo.fr>

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

 share/lua/http/index.html | 2 +-
 share/lua/http/js/ui.js   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/share/lua/http/index.html b/share/lua/http/index.html
index 211fa08eec..4a8a4ff51c 100644
--- a/share/lua/http/index.html
+++ b/share/lua/http/index.html
@@ -168,7 +168,7 @@
 					modal: true,
 					buttons:{
 						"<?vlc gettext("Yes") ?>":function(){
-							var file			=	$('[current="current"]','#libraryTree').length>0 ? $('[current="current"]','#libraryTree').first().attr('uri') : ($('.jstree-clicked','#libraryTree').length>0 ? $('.jstree-clicked','#libraryTree').first().parents().first().attr('uri') : ($('#plid_'+current_id).attr('uri') ? $('#plid_'+current_id).attr('uri') : false));
+							var file			=	$('[current="current"]','#libraryTree').length>0 ? $('[current="current"]','#libraryTree').first().attr('uri') : ($('.jstree-clicked','#libraryTree').length>0 ? $('.jstree-clicked','#libraryTree').first().parents().first().attr('uri') : ($('#plid_'+current_playlist_id).attr('uri') ? $('#plid_'+current_playlist_id).attr('uri') : false));
 							if(file){
 								if($('#viewContainer').css('display')=='none'){
 									$('#buttonViewer').click();
diff --git a/share/lua/http/js/ui.js b/share/lua/http/js/ui.js
index a404ef0ef8..3950bf056c 100644
--- a/share/lua/http/js/ui.js
+++ b/share/lua/http/js/ui.js
@@ -61,7 +61,7 @@ $(function () {
         if ($(this).attr('state') == 'stopped') {
             switch (current_que) {
             case 'main':
-                var id = $('.jstree-clicked', '#libraryTree').length > 0 ? $('.jstree-clicked', '#libraryTree').first().parents().first().attr('id').substr(5) : current_id;
+                var id = $('.jstree-clicked', '#libraryTree').length > 0 ? $('.jstree-clicked', '#libraryTree').first().parents().first().attr('id').substr(5) : current_playlist_id;
                 sendCommand({
                     'command': 'pl_play',
                     'id': id



More information about the vlc-commits mailing list