[vlc-commits] Web Interface: correctly select extensions

Jean-Baptiste Kempf git at videolan.org
Sat Mar 31 23:59:06 CEST 2012


vlc/vlc-2.0 | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Sat Mar 31 22:53:17 2012 +0200| [9cba28d804dec6a1eea7523392877cab6e6ef0ff] | committer: Jean-Baptiste Kempf

Web Interface: correctly select extensions

Close #6544
(cherry picked from commit 0585f02300f36b5149efff555b3ea65d7fd3ed49)

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc/vlc-2.0.git/?a=commit;h=9cba28d804dec6a1eea7523392877cab6e6ef0ff
---

 share/lua/http/js/controlers.js |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/share/lua/http/js/controlers.js b/share/lua/http/js/controlers.js
index 805f3bb..e9a6067 100644
--- a/share/lua/http/js/controlers.js
+++ b/share/lua/http/js/controlers.js
@@ -166,8 +166,9 @@ function browse(dir) {
             var tgt = browse_target.indexOf('__') == -1 ? browse_target : browse_target.substr(0, browse_target.indexOf('__'));
             $('#browse_elements').empty();
             $('element', data).each(function () {
-                if ($(this).attr('type') == 'dir' || $.inArray($(this).attr('name').substr(-3), video_types) != -1 || $.inArray($(this).attr('name').substr(-3), audio_types) != -1) {
-                    $('#browse_elements').append(createElementLi($(this).attr('name'), $(this).attr('type'), $(this).attr('uri'), $(this).attr('name').substr(-3)));
+                var ext = $(this).attr('name').substr($(this).attr('name').lastIndexOf('.') + 1);
+                if ($(this).attr('type') == 'dir' || $.inArray(ext, video_types) != -1 || $.inArray(ext, audio_types) != -1) {
+                    $('#browse_elements').append(createElementLi($(this).attr('name'), $(this).attr('type'), $(this).attr('uri'), ext));
                 }
             });
             $('[opendir]').dblclick(function () {



More information about the vlc-commits mailing list