mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-09-06 20:20:41 +02:00
Compare commits
5 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
ba4532593b | ||
|
c84fd28dd2 | ||
|
dbbb491a81 | ||
|
bab5e27673 | ||
|
17f71bd366 |
@@ -13,7 +13,7 @@ SET( TOMAHAWK_DESCRIPTION_SUMMARY "The social media player" )
|
||||
|
||||
SET( TOMAHAWK_VERSION_MAJOR 0 )
|
||||
SET( TOMAHAWK_VERSION_MINOR 5 )
|
||||
SET( TOMAHAWK_VERSION_PATCH 1 )
|
||||
SET( TOMAHAWK_VERSION_PATCH 2 )
|
||||
|
||||
#SET( TOMAHAWK_VERSION_RC 0 )
|
||||
|
||||
|
@@ -1,3 +1,7 @@
|
||||
Version 0.5.2:
|
||||
* Fixed a crash when invalid results are coming back from a resolver or
|
||||
are found in a playlist.
|
||||
|
||||
Version 0.5.1:
|
||||
* Fixed a few issues with automatic downloading and launching
|
||||
of the Spotify account.
|
||||
|
@@ -54,6 +54,7 @@ PlaylistEntry::setQueryVariant( const QVariant& v )
|
||||
QString artist = m.value( "artist" ).toString();
|
||||
QString album = m.value( "album" ).toString();
|
||||
QString track = m.value( "track" ).toString();
|
||||
|
||||
m_query = Tomahawk::Query::get( artist, track, album );
|
||||
}
|
||||
|
||||
|
@@ -59,10 +59,11 @@ public:
|
||||
PlaylistEntry();
|
||||
virtual ~PlaylistEntry();
|
||||
|
||||
bool isValid() const { return !m_query.isNull(); }
|
||||
|
||||
void setQuery( const Tomahawk::query_ptr& q );
|
||||
const Tomahawk::query_ptr& query() const;
|
||||
|
||||
// I wish Qt did this for me once i specified the Q_PROPERTIES:
|
||||
void setQueryVariant( const QVariant& v );
|
||||
QVariant queryVariant() const;
|
||||
|
||||
|
@@ -80,7 +80,6 @@ DatabaseCommand_SetPlaylistRevision::DatabaseCommand_SetPlaylistRevision(
|
||||
tmp << s;
|
||||
|
||||
setOrderedguids( tmp );
|
||||
|
||||
setPlaylistguid( playlistguid );
|
||||
}
|
||||
|
||||
@@ -100,7 +99,6 @@ DatabaseCommand_SetPlaylistRevision::postCommitHook()
|
||||
playlist_ptr playlist = source()->collection()->playlist( m_playlistguid );
|
||||
if ( playlist.isNull() )
|
||||
{
|
||||
qDebug() << m_playlistguid;
|
||||
Q_ASSERT( !playlist.isNull() );
|
||||
return;
|
||||
}
|
||||
@@ -150,7 +148,9 @@ DatabaseCommand_SetPlaylistRevision::exec( DatabaseImpl* lib )
|
||||
|
||||
foreach( const plentry_ptr& e, m_entries )
|
||||
{
|
||||
if ( e->query()->results().isEmpty() )
|
||||
if ( !e->isValid() )
|
||||
continue;
|
||||
if ( !e->query()->numResults() )
|
||||
continue;
|
||||
|
||||
adde.bindValue( 0, e->query()->results().first()->url() );
|
||||
@@ -167,6 +167,9 @@ DatabaseCommand_SetPlaylistRevision::exec( DatabaseImpl* lib )
|
||||
|
||||
foreach( const plentry_ptr& e, m_entries )
|
||||
{
|
||||
if ( !e->isValid() )
|
||||
continue;
|
||||
|
||||
adde.bindValue( 0, e->query()->track() );
|
||||
adde.bindValue( 1, e->query()->artist() );
|
||||
adde.bindValue( 2, e->query()->album() );
|
||||
@@ -189,6 +192,9 @@ DatabaseCommand_SetPlaylistRevision::exec( DatabaseImpl* lib )
|
||||
qDebug() << "Num new playlist_items to add:" << m_addedentries.length();
|
||||
foreach( const plentry_ptr& e, m_addedentries )
|
||||
{
|
||||
if ( !e->isValid() )
|
||||
continue;
|
||||
|
||||
// qDebug() << "Adding:" << e->guid() << e->query()->track() << e->query()->artist();
|
||||
|
||||
m_addedmap.insert( e->guid(), e ); // needed in postcommithook
|
||||
|
@@ -77,9 +77,11 @@ public:
|
||||
m_addedentries.clear();
|
||||
foreach( const QVariant& v, vlist )
|
||||
{
|
||||
PlaylistEntry * pep = new PlaylistEntry;
|
||||
PlaylistEntry* pep = new PlaylistEntry;
|
||||
QJson::QObjectHelper::qvariant2qobject( v.toMap(), pep );
|
||||
m_addedentries << plentry_ptr(pep);
|
||||
|
||||
if ( pep->isValid() )
|
||||
m_addedentries << plentry_ptr( pep );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -88,6 +90,9 @@ public:
|
||||
QVariantList vlist;
|
||||
foreach( const plentry_ptr& pe, m_addedentries )
|
||||
{
|
||||
if ( !pe->isValid() )
|
||||
continue;
|
||||
|
||||
QVariant v = QJson::QObjectHelper::qobject2qvariant( pe.data() );
|
||||
vlist << v;
|
||||
}
|
||||
|
@@ -408,6 +408,8 @@ QtScriptResolver::parseResultVariantList( const QVariantList& reslist )
|
||||
foreach( const QVariant& rv, reslist )
|
||||
{
|
||||
QVariantMap m = rv.toMap();
|
||||
if ( m.value( "artist" ).toString().trimmed().isEmpty() || m.value( "track" ).toString().trimmed().isEmpty() )
|
||||
continue;
|
||||
|
||||
Tomahawk::result_ptr rp = Tomahawk::Result::get( m.value( "url" ).toString() );
|
||||
Tomahawk::artist_ptr ap = Tomahawk::Artist::get( m.value( "artist" ).toString(), false );
|
||||
|
@@ -269,7 +269,9 @@ ScriptResolver::handleMsg( const QByteArray& msg )
|
||||
foreach( const QVariant& rv, reslist )
|
||||
{
|
||||
QVariantMap m = rv.toMap();
|
||||
qDebug() << "Found result:" << m;
|
||||
tDebug( LOGVERBOSE ) << "Found result:" << m;
|
||||
if ( m.value( "artist" ).toString().trimmed().isEmpty() || m.value( "track" ).toString().trimmed().isEmpty() )
|
||||
continue;
|
||||
|
||||
Tomahawk::result_ptr rp = Tomahawk::Result::get( m.value( "url" ).toString() );
|
||||
Tomahawk::artist_ptr ap = Tomahawk::Artist::get( m.value( "artist" ).toString(), false );
|
||||
|
Reference in New Issue
Block a user