From: Antoine Cellerier Date: Sun, 19 Aug 2007 17:48:28 +0000 (+0000) Subject: Only reload album art in the HTTP interface if the track id changes (or if the user... X-Git-Tag: 0.9.0-test0~6368 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=f7113175dd618707b2fd649cdf558eb9eb660451;p=vlc Only reload album art in the HTTP interface if the track id changes (or if the user clicks on the album art to force a reload). --- diff --git a/share/http/dialogs/main b/share/http/dialogs/main index 49086d4d34..ecf038a076 100644 --- a/share/http/dialogs/main +++ b/share/http/dialogs/main @@ -106,7 +106,7 @@ sout and playlist . slider leftslider pointslider right
(?) - Album art + diff --git a/share/http/js/functions.js b/share/http/js/functions.js index 7f2db21ab2..e1dfe79a24 100644 --- a/share/http/js/functions.js +++ b/share/http/js/functions.js @@ -27,6 +27,7 @@ var old_time = 0; var pl_cur_id; +var albumart_id = -1; /********************************************************************** * Slider functions @@ -1039,11 +1040,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 +1065,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() {