1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-03-20 07:49:42 +01:00

Simplify setting the year on results in scriptresolver

This commit is contained in:
Dominik Schmidt 2012-01-22 19:15:10 +01:00
parent b06d50be98
commit 68b146e560

View File

@ -243,13 +243,14 @@ ScriptResolver::handleMsg( const QByteArray& msg )
Tomahawk::artist_ptr ap = Tomahawk::Artist::get( m.value( "artist" ).toString(), false );
rp->setArtist( ap );
rp->setAlbum( Tomahawk::Album::get( ap, m.value( "album" ).toString(), false ) );
rp->setAlbumPos( m.value( "albumpos" ).toInt() );
rp->setAlbumPos( m.value( "albumpos" ).toUInt() );
rp->setTrack( m.value( "track" ).toString() );
rp->setDuration( m.value( "duration" ).toUInt() );
rp->setBitrate( m.value( "bitrate" ).toUInt() );
rp->setSize( m.value( "size" ).toUInt() );
rp->setRID( uuid() );
rp->setFriendlySource( m_name );
rp->setYear( m.value( "year ").toUInt() );
rp->setMimetype( m.value( "mimetype" ).toString() );
if ( rp->mimetype().isEmpty() )
@ -257,12 +258,6 @@ ScriptResolver::handleMsg( const QByteArray& msg )
rp->setMimetype( TomahawkUtils::extensionToMimetype( m.value( "extension" ).toString() ) );
Q_ASSERT( !rp->mimetype().isEmpty() );
}
if ( m.contains( "year" ) )
{
QVariantMap attr;
attr[ "releaseyear" ] = m.value( "year" );
rp->setAttributes( attr );
}
results << rp;
}