1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-01-17 14:28:24 +01:00

Do not set empty mimetype on results

This commit is contained in:
Dominik Schmidt 2016-02-11 00:55:23 +01:00
parent 87278456f4
commit 0bdb8061e2

View File

@ -370,11 +370,17 @@ ScriptAccount::parseResultVariantList( const QVariantList& reslist )
// rp->track()->setAttributes( attr );
}
rp->setMimetype( m.value( "mimetype" ).toString() );
if ( rp->mimetype().isEmpty() )
QString mimetype = m.value( "mimetype" ).toString();
if ( mimetype.isEmpty() )
{
rp->setMimetype( TomahawkUtils::extensionToMimetype( m.value( "extension" ).toString() ) );
Q_ASSERT( !rp->mimetype().isEmpty() );
mimetype = TomahawkUtils::extensionToMimetype( m.value( "extension" ).toString() );
}
Q_ASSERT( !mimetype.isEmpty() );
if ( !mimetype.isEmpty() )
{
rp->setMimetype( mimetype );
}
rp->setFriendlySource( name() );