diff --git a/src/libtomahawk/resolvers/ScriptAccount.cpp b/src/libtomahawk/resolvers/ScriptAccount.cpp index 687543fd1..3d4ca231b 100644 --- a/src/libtomahawk/resolvers/ScriptAccount.cpp +++ b/src/libtomahawk/resolvers/ScriptAccount.cpp @@ -2,6 +2,7 @@ * * Copyright (C) 2011 Leo Franchi * Copyright (C) 2014 Dominik Schmidt + * Copyright (C) 2015, Christian Muehlhaeuser * * Tomahawk is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -313,6 +314,21 @@ ScriptAccount::parseResultVariantList( const QVariantList& reslist ) rp->setFriendlySource( name() ); + QList fl; + foreach ( const QVariant& foo, m.value( "downloadUrls" ).toList() ) + { + QVariantMap downloadUrl = foo.toMap(); + tLog() << "downloadUrl:" << downloadUrl.value( "url" ).toUrl() << "drm:" << downloadUrl.value( "drm" ).toBool() << "extension:" << downloadUrl.value( "extension").toString().toLower() << "bitrate:" << downloadUrl.value( "bitrate" ).toInt(); + + DownloadFormat format; + format.url = downloadUrl.value( "url" ).toUrl(); + format.extension = downloadUrl.value( "extension").toString().toLower(); + format.mimetype = TomahawkUtils::extensionToMimetype( format.extension ); + + fl << format; + } + rp->setDownloadFormats( fl ); + // find collection const QString collectionId = m.value( "collectionId" ).toString(); if ( !collectionId.isEmpty() ) diff --git a/src/libtomahawk/resolvers/ScriptAccount.h b/src/libtomahawk/resolvers/ScriptAccount.h index 03cece65e..1c9890d9e 100644 --- a/src/libtomahawk/resolvers/ScriptAccount.h +++ b/src/libtomahawk/resolvers/ScriptAccount.h @@ -2,6 +2,7 @@ * * Copyright (C) 2011 Leo Franchi * Copyright (C) 2014 Dominik Schmidt + * Copyright (C) 2015, Christian Muehlhaeuser * * Tomahawk is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by