mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-15 02:24:50 +02:00
* Only show top 50 loved tracks for the SuperCollection.
This commit is contained in:
@@ -42,7 +42,7 @@ CustomPlaylistView::CustomPlaylistView( CustomPlaylistView::PlaylistType type, c
|
|||||||
|
|
||||||
if ( m_type == SourceLovedTracks )
|
if ( m_type == SourceLovedTracks )
|
||||||
connect( m_source.data(), SIGNAL( socialAttributesChanged( QString ) ), this, SLOT( socialAttributesChanged( QString ) ) );
|
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 ) ) );
|
connect( SourceList::instance()->getLocal().data(), SIGNAL( socialAttributesChanged( QString ) ), this, SLOT( socialAttributesChanged( QString ) ) );
|
||||||
foreach ( const source_ptr& s, SourceList::instance()->sources( true ) )
|
foreach ( const source_ptr& s, SourceList::instance()->sources( true ) )
|
||||||
@@ -86,12 +86,12 @@ CustomPlaylistView::generateTracks()
|
|||||||
"GROUP BY track.id "
|
"GROUP BY track.id "
|
||||||
"ORDER BY counter DESC, social_attributes.timestamp DESC " ).arg( m_source->isLocal() ? "IS NULL" : QString( "= %1" ).arg( m_source->id() ) );
|
"ORDER BY counter DESC, social_attributes.timestamp DESC " ).arg( m_source->isLocal() ? "IS NULL" : QString( "= %1" ).arg( m_source->id() ) );
|
||||||
break;
|
break;
|
||||||
case AllLovedTracks:
|
case TopLovedTracks:
|
||||||
sql = QString( "SELECT track.name, artist.name, source, COUNT(*) as counter "
|
sql = QString( "SELECT track.name, artist.name, source, COUNT(*) as counter "
|
||||||
"FROM social_attributes, track, artist "
|
"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 "
|
"GROUP BY track.id "
|
||||||
"ORDER BY counter DESC, social_attributes.timestamp DESC " );
|
"ORDER BY counter DESC, social_attributes.timestamp DESC LIMIT 0, 50" );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -33,7 +33,7 @@ class DLLEXPORT CustomPlaylistView : public PlaylistView
|
|||||||
public:
|
public:
|
||||||
enum PlaylistType {
|
enum PlaylistType {
|
||||||
SourceLovedTracks,
|
SourceLovedTracks,
|
||||||
AllLovedTracks
|
TopLovedTracks
|
||||||
};
|
};
|
||||||
|
|
||||||
explicit CustomPlaylistView( PlaylistType type, const source_ptr& s, QWidget* parent = 0 );
|
explicit CustomPlaylistView( PlaylistType type, const source_ptr& s, QWidget* parent = 0 );
|
||||||
|
@@ -432,7 +432,7 @@ Tomahawk::ViewPage*
|
|||||||
ViewManager::showTopLovedPage()
|
ViewManager::showTopLovedPage()
|
||||||
{
|
{
|
||||||
if ( !m_topLovedWidget )
|
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 );
|
return show( m_topLovedWidget );
|
||||||
}
|
}
|
||||||
|
@@ -486,7 +486,7 @@ ViewPage*
|
|||||||
SourceItem::lovedTracksClicked()
|
SourceItem::lovedTracksClicked()
|
||||||
{
|
{
|
||||||
if ( !m_lovedTracksPage )
|
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 );
|
ViewManager::instance()->show( m_lovedTracksPage );
|
||||||
return m_lovedTracksPage;
|
return m_lovedTracksPage;
|
||||||
|
Reference in New Issue
Block a user