1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-04-20 07:52:30 +02:00

Store preview flag from script-resolver-results in actual results

This commit is contained in:
Dominik Schmidt 2015-04-02 01:20:26 +02:00
parent f05f9a25c1
commit 3a22c22cab
3 changed files with 21 additions and 0 deletions

View File

@ -99,6 +99,7 @@ Result::getCached( const QString& url )
Result::Result( const QString& url, const track_ptr& track )
: QObject()
, m_url( url )
, m_isPreview( false )
, m_checked( false )
, m_bitrate( 0 )
, m_size( 0 )
@ -163,6 +164,13 @@ Result::checked() const
}
bool
Result::isPreview() const
{
return m_isPreview;
}
QString
Result::mimetype() const
{
@ -231,6 +239,8 @@ Result::toVariant() const
m.insert( "sid", id() );
m.insert( "discnumber", m_track->discnumber() );
m.insert( "albumpos", m_track->albumpos() );
m.insert( "preview", isPreview() );
m.insert( "purchaseUrl", purchaseUrl() );
if ( !m_track->composer().isEmpty() )
m.insert( "composer", m_track->composer() );
@ -319,6 +329,13 @@ Result::setFriendlySource( const QString& s )
}
void
Result::setPreview( bool isPreview )
{
m_isPreview = isPreview;
}
void
Result::setPurchaseUrl( const QString& u )
{

View File

@ -103,6 +103,7 @@ public:
bool checked() const;
QString mimetype() const;
QString friendlySource() const;
bool isPreview() const;
QString purchaseUrl() const;
QString linkUrl() const;
@ -117,6 +118,7 @@ public:
void setRID( RID id ) { m_rid = id; }
void setFriendlySource( const QString& s );
void setPreview( bool isPreview );
void setPurchaseUrl( const QString& u );
void setLinkUrl( const QString& u );
void setChecked( bool checked );
@ -162,6 +164,7 @@ private:
QPointer< Tomahawk::Resolver > m_resolver;
QString m_url;
bool m_isPreview;
QString m_purchaseUrl;
QString m_linkUrl;
QString m_mimetype;

View File

@ -288,6 +288,7 @@ ScriptAccount::parseResultVariantList( const QVariantList& reslist )
rp->setBitrate( m.value( "bitrate" ).toUInt() );
rp->setSize( m.value( "size" ).toUInt() );
rp->setRID( uuid() );
rp->setPreview( m.value( "preview" ).toBool() );
rp->setPurchaseUrl( m.value( "purchaseUrl" ).toString() );
rp->setLinkUrl( m.value( "linkUrl" ).toString() );
rp->setScore( m.value( "score" ).toFloat() );