From 0bdb8061e2233cb6d14d8b77a20b12595628c1de Mon Sep 17 00:00:00 2001 From: Dominik Schmidt Date: Thu, 11 Feb 2016 00:55:23 +0100 Subject: [PATCH] Do not set empty mimetype on results --- src/libtomahawk/resolvers/ScriptAccount.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/libtomahawk/resolvers/ScriptAccount.cpp b/src/libtomahawk/resolvers/ScriptAccount.cpp index 0d2f3ebdb..11156b210 100644 --- a/src/libtomahawk/resolvers/ScriptAccount.cpp +++ b/src/libtomahawk/resolvers/ScriptAccount.cpp @@ -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() );