From: Antoine Cellerier Date: Sat, 18 Mar 2006 01:22:06 +0000 (+0000) Subject: HTTP interface: Display estimated item time when available. X-Git-Tag: 0.9.0-test0~11877 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;ds=sidebyside;h=e970f05feea86232fa44adf951b680411b57ade8;p=vlc HTTP interface: Display estimated item time when available. --- diff --git a/modules/control/http/util.c b/modules/control/http/util.c index e2d77f7615..b12ccde8bd 100644 --- a/modules/control/http/util.c +++ b/modules/control/http/util.c @@ -458,6 +458,9 @@ void E_(PlaylistListNode)( intf_thread_t *p_intf, playlist_t *p_pl, E_(mvar_AppendNewVar)( itm, "ro", "rw" ); } + sprintf( value, "%d", p_node->input.i_duration ); + E_(mvar_AppendNewVar)( itm, "duration", value ); + E_(mvar_AppendVar)( s, itm ); } else diff --git a/share/http/dialogs/playlist b/share/http/dialogs/playlist index 4eb89f577f..9e7ab7f8ef 100644 --- a/share/http/dialogs/playlist +++ b/share/http/dialogs/playlist @@ -71,7 +71,7 @@ This dialog needs the following dialogs to be fully functional: diff --git a/share/http/js/functions.js b/share/http/js/functions.js index eeac8f966e..e1a0031852 100644 --- a/share/http/js/functions.js +++ b/share/http/js/functions.js @@ -557,6 +557,9 @@ function parse_playlist() } pl.setAttribute( 'title', elt.getAttribute( 'uri' )); pl.appendChild( document.createTextNode( elt.getAttribute( 'name' ) ) ); + var duration = elt.getAttribute( 'duration' ); + if( duration > 0 ) + pl.appendChild( document.createTextNode( " (" + format_time( elt.getAttribute( 'duration' ) / 1000000 ) + ")" ) ); pos.appendChild( pl ); if( elt.getAttribute( 'ro' ) == 'rw' ) diff --git a/share/http/requests/playlist.xml b/share/http/requests/playlist.xml index f8b3cddcc4..debe400096 100644 --- a/share/http/requests/playlist.xml +++ b/share/http/requests/playlist.xml @@ -35,7 +35,7 @@ - " current="current" uri="" name="" ro="" /> + " current="current" uri="" name="" ro="" duration="" /> " name="" ro="" >