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:
parent
f05f9a25c1
commit
3a22c22cab
@ -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 )
|
||||
{
|
||||
|
@ -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;
|
||||
|
@ -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() );
|
||||
|
Loading…
x
Reference in New Issue
Block a user