]> git.sesse.net Git - vlc/blobdiff - share/http/js/functions.js
The playlist it not lock here.
[vlc] / share / http / js / functions.js
index 7f2db21ab2ca17b14aa7b061838b443ceb2b79e7..fcd6c7a1677b9b7879ef6964be5802b9277c4dbe 100644 (file)
@@ -27,6 +27,7 @@
 
 var old_time = 0;
 var pl_cur_id;
+var albumart_id = -1;
 
 /**********************************************************************
  * Slider functions
@@ -629,6 +630,7 @@ function parse_playlist()
                     {
                         elt = elt.parentNode;
                         if( ! elt.parentNode ) break;
+                        pos = pos.parentNode;
                     }
                     if( ! elt.parentNode ) break;
                     elt = elt.parentNode.nextSibling;
@@ -819,7 +821,7 @@ function update_input_fake()
 {
     var mrl = document.getElementById( 'input_mrl' );
 
-    mrl.value = "fake:";
+    mrl.value = "fake://";
     mrl.value += " :fake-file=" + value( "input_fake_filename" );
 
     if( value( "input_fake_width" ) )
@@ -1039,11 +1041,15 @@ function browse_path( p )
     hide( 'browse' );
     document.getElementById( value( 'browse_dest' ) ).focus();
 }
-function refresh_albumart()
+function refresh_albumart( force )
 {
-    var now = new Date();
-    var albumart = document.getElementById( 'albumart' );
-    albumart.src = '/art?timestamp=' + now.getTime();
+    if( albumart_id != pl_cur_id || force )
+    {
+        var now = new Date();
+        var albumart = document.getElementById( 'albumart' );
+        albumart.src = '/art?timestamp=' + now.getTime();
+        albumart_id = pl_cur_id;
+    }
 }
 /**********************************************************************
  * Periodically update stuff in the interface
@@ -1060,8 +1066,8 @@ function loop_refresh_playlist()
 }
 function loop_refresh_albumart()
 {
-    setTimeout( 'loop_refresh_albumart()', 10000 );
-    refresh_albumart();
+    setTimeout( 'loop_refresh_albumart()', 1000 );
+    refresh_albumart( false );
 }
 function loop_refresh()
 {