From a708f37cd607865de97bad73a86d839dafb95f32 Mon Sep 17 00:00:00 2001 From: Leo Franchi Date: Mon, 17 Oct 2011 17:44:57 -0400 Subject: [PATCH] Include preview tracks in deduper --- src/libtomahawk/playlist/dynamic/DynamicModel.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/libtomahawk/playlist/dynamic/DynamicModel.cpp b/src/libtomahawk/playlist/dynamic/DynamicModel.cpp index 617619e33..167baca9a 100644 --- a/src/libtomahawk/playlist/dynamic/DynamicModel.cpp +++ b/src/libtomahawk/playlist/dynamic/DynamicModel.cpp @@ -97,14 +97,11 @@ DynamicModel::newTrackGenerated( const Tomahawk::query_ptr& query ) { if( m_onDemandRunning ) { bool isDuplicate = false; - qDebug() << "Deduping:" << query->track() << query->artist(); for ( int i = 0; i < m_deduper.size(); i++ ) { - qDebug() << "Checking against:" << m_deduper[ i ].first << m_deduper[ i ].second; if ( m_deduper[ i ].first == query->track() && m_deduper[ i ].second == query->artist() ) isDuplicate = true; } - qDebug() << "is dup?" << isDuplicate; if ( isDuplicate ) { m_playlist->generator()->fetchNext(); @@ -289,6 +286,9 @@ DynamicModel::addToPlaylist( const QList< query_ptr >& entries, bool clearFirst if( clearFirst ) clear(); + foreach ( const query_ptr& q, entries ) + m_deduper.append( QPair< QString, QString >( q->track(), q->artist() ) ); + if( m_playlist->author()->isLocal() && m_playlist->mode() == Static ) { m_playlist->addEntries( entries, m_playlist->currentrevision() ); } else { // read-only, so add tracks only in the GUI, not to the playlist itself