diff --git a/src/libtomahawk/playlist/customplaylistview.cpp b/src/libtomahawk/playlist/customplaylistview.cpp index 1cb9517cd..5e81cd6ca 100644 --- a/src/libtomahawk/playlist/customplaylistview.cpp +++ b/src/libtomahawk/playlist/customplaylistview.cpp @@ -42,7 +42,7 @@ CustomPlaylistView::CustomPlaylistView( CustomPlaylistView::PlaylistType type, c if ( m_type == SourceLovedTracks ) connect( m_source.data(), SIGNAL( socialAttributesChanged( QString ) ), this, SLOT( socialAttributesChanged( QString ) ) ); - else if ( m_type == AllLovedTracks ) + else if ( m_type == TopLovedTracks ) { connect( SourceList::instance()->getLocal().data(), SIGNAL( socialAttributesChanged( QString ) ), this, SLOT( socialAttributesChanged( QString ) ) ); foreach ( const source_ptr& s, SourceList::instance()->sources( true ) ) @@ -86,12 +86,12 @@ CustomPlaylistView::generateTracks() "GROUP BY track.id " "ORDER BY counter DESC, social_attributes.timestamp DESC " ).arg( m_source->isLocal() ? "IS NULL" : QString( "= %1" ).arg( m_source->id() ) ); break; - case AllLovedTracks: + case TopLovedTracks: sql = QString( "SELECT track.name, artist.name, source, COUNT(*) as counter " "FROM social_attributes, track, artist " - "WHERE social_attributes.id = track.id AND artist.id = track.artist AND social_attributes.k = 'Love' AND social_attributes.v = 'true'" + "WHERE social_attributes.id = track.id AND artist.id = track.artist AND social_attributes.k = 'Love' AND social_attributes.v = 'true' " "GROUP BY track.id " - "ORDER BY counter DESC, social_attributes.timestamp DESC " ); + "ORDER BY counter DESC, social_attributes.timestamp DESC LIMIT 0, 50" ); break; } diff --git a/src/libtomahawk/playlist/customplaylistview.h b/src/libtomahawk/playlist/customplaylistview.h index f03ede49b..692980e40 100644 --- a/src/libtomahawk/playlist/customplaylistview.h +++ b/src/libtomahawk/playlist/customplaylistview.h @@ -33,7 +33,7 @@ class DLLEXPORT CustomPlaylistView : public PlaylistView public: enum PlaylistType { SourceLovedTracks, - AllLovedTracks + TopLovedTracks }; explicit CustomPlaylistView( PlaylistType type, const source_ptr& s, QWidget* parent = 0 ); diff --git a/src/libtomahawk/viewmanager.cpp b/src/libtomahawk/viewmanager.cpp index 0816d8203..d87f9038a 100644 --- a/src/libtomahawk/viewmanager.cpp +++ b/src/libtomahawk/viewmanager.cpp @@ -432,7 +432,7 @@ Tomahawk::ViewPage* ViewManager::showTopLovedPage() { if ( !m_topLovedWidget ) - m_topLovedWidget = new CustomPlaylistView( CustomPlaylistView::AllLovedTracks, source_ptr(), m_widget ); + m_topLovedWidget = new CustomPlaylistView( CustomPlaylistView::TopLovedTracks, source_ptr(), m_widget ); return show( m_topLovedWidget ); } diff --git a/src/sourcetree/items/sourceitem.cpp b/src/sourcetree/items/sourceitem.cpp index f4084b38e..ede45229e 100644 --- a/src/sourcetree/items/sourceitem.cpp +++ b/src/sourcetree/items/sourceitem.cpp @@ -486,7 +486,7 @@ ViewPage* SourceItem::lovedTracksClicked() { if ( !m_lovedTracksPage ) - m_lovedTracksPage = new CustomPlaylistView( m_source.isNull() ? CustomPlaylistView::AllLovedTracks : CustomPlaylistView::SourceLovedTracks, m_source, ViewManager::instance()->widget() ); + m_lovedTracksPage = new CustomPlaylistView( m_source.isNull() ? CustomPlaylistView::TopLovedTracks : CustomPlaylistView::SourceLovedTracks, m_source, ViewManager::instance()->widget() ); ViewManager::instance()->show( m_lovedTracksPage ); return m_lovedTracksPage;