mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-04-14 04:51:53 +02:00
* Fixed QtScriptResolver's durationString parsing.
This commit is contained in:
parent
1a5d06ed28
commit
3c936414fd
@ -104,7 +104,6 @@ ScriptEngine::resolve( const Tomahawk::query_ptr& query )
|
||||
rp->setArtist( ap );
|
||||
rp->setAlbum( Tomahawk::Album::get( 0, m.value( "album" ).toString(), ap ) );
|
||||
rp->setTrack( m.value( "track" ).toString() );
|
||||
rp->setDuration( m.value( "duration" ).toUInt() );
|
||||
rp->setBitrate( m.value( "bitrate" ).toUInt() );
|
||||
rp->setUrl( m.value( "url" ).toString() );
|
||||
rp->setSize( m.value( "size" ).toUInt() );
|
||||
@ -112,6 +111,13 @@ ScriptEngine::resolve( const Tomahawk::query_ptr& query )
|
||||
rp->setRID( uuid() );
|
||||
rp->setFriendlySource( m_parent->name() );
|
||||
|
||||
rp->setDuration( m.value( "duration", 0 ).toUInt() );
|
||||
if ( rp->duration() <= 0 && m.contains( "durationString" ) )
|
||||
{
|
||||
QTime time = QTime::fromString( m.value( "durationString" ).toString(), "hh:mm:ss" );
|
||||
rp->setDuration( time.secsTo( QTime( 0, 0 ) ) * -1 );
|
||||
}
|
||||
|
||||
rp->setMimetype( m.value( "mimetype" ).toString() );
|
||||
if ( rp->mimetype().isEmpty() )
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user