mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-06 14:16:32 +02:00
Set downloadable formats on Results, if available.
This commit is contained in:
@@ -2,6 +2,7 @@
|
|||||||
*
|
*
|
||||||
* Copyright (C) 2011 Leo Franchi <lfranchi@kde.org>
|
* Copyright (C) 2011 Leo Franchi <lfranchi@kde.org>
|
||||||
* Copyright (C) 2014 Dominik Schmidt <domme@tomahawk-player.org>
|
* Copyright (C) 2014 Dominik Schmidt <domme@tomahawk-player.org>
|
||||||
|
* Copyright (C) 2015, Christian Muehlhaeuser <muesli@tomahawk-player.org>
|
||||||
*
|
*
|
||||||
* Tomahawk is free software: you can redistribute it and/or modify
|
* Tomahawk is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* 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() );
|
rp->setFriendlySource( name() );
|
||||||
|
|
||||||
|
QList<DownloadFormat> 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
|
// find collection
|
||||||
const QString collectionId = m.value( "collectionId" ).toString();
|
const QString collectionId = m.value( "collectionId" ).toString();
|
||||||
if ( !collectionId.isEmpty() )
|
if ( !collectionId.isEmpty() )
|
||||||
|
@@ -2,6 +2,7 @@
|
|||||||
*
|
*
|
||||||
* Copyright (C) 2011 Leo Franchi <lfranchi@kde.org>
|
* Copyright (C) 2011 Leo Franchi <lfranchi@kde.org>
|
||||||
* Copyright (C) 2014 Dominik Schmidt <domme@tomahawk-player.org>
|
* Copyright (C) 2014 Dominik Schmidt <domme@tomahawk-player.org>
|
||||||
|
* Copyright (C) 2015, Christian Muehlhaeuser <muesli@tomahawk-player.org>
|
||||||
*
|
*
|
||||||
* Tomahawk is free software: you can redistribute it and/or modify
|
* Tomahawk is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
Reference in New Issue
Block a user