Commit aa648afd authored by Rémi Duraffort's avatar Rémi Duraffort

lua_http: fix duration printing.

parent 7f67708e
...@@ -616,7 +616,7 @@ function parse_playlist() ...@@ -616,7 +616,7 @@ function parse_playlist()
pl.appendChild( document.createTextNode( elt.getAttribute( 'name' ) ) ); pl.appendChild( document.createTextNode( elt.getAttribute( 'name' ) ) );
var duration = elt.getAttribute( 'duration' ); var duration = elt.getAttribute( 'duration' );
if( duration > 0 ) if( duration > 0 )
pl.appendChild( document.createTextNode( " (" + format_time( elt.getAttribute( 'duration' ) / 1000000 ) + ")" ) ); pl.appendChild( document.createTextNode( " (" + format_time( elt.getAttribute( 'duration' ) ) + ")" ) );
pos.appendChild( pl ); pos.appendChild( pl );
if( elt.getAttribute( 'ro' ) == 'rw' ) if( elt.getAttribute( 'ro' ) == 'rw' )
......
...@@ -57,7 +57,7 @@ function print_playlist(item) ...@@ -57,7 +57,7 @@ function print_playlist(item)
current = 'current="current"' current = 'current="current"'
end end
end end
print('<leaf id="' ..tostring(item.id).. '" uri="' ..tostring(path).. '" name="' ..name.. '" ro="' ..(item.flags.ro and "ro" or "rw").. '" duration ="' ..tostring(item.duration).. '" ' ..current.. ' />') print('<leaf id="' ..tostring(item.id).. '" uri="' ..tostring(path).. '" name="' ..name.. '" ro="' ..(item.flags.ro and "ro" or "rw").. '" duration ="' ..math.floor(item.duration).. '" ' ..current.. ' />')
end end
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment