1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-14 01:54:07 +02:00

Sort by time and show source's own loved tracks

This commit is contained in:
Leo Franchi
2011-08-06 17:24:05 -04:00
parent ffd5a2f81e
commit b9733249ee

View File

@@ -50,16 +50,16 @@ CustomPlaylistView::generateTracks()
case SourceLovedTracks:
sql = QString( "SELECT track.name, artist.name, 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 source IS NULL "
"WHERE social_attributes.id = track.id AND artist.id = track.artist AND social_attributes.k = 'Love' AND social_attributes.source %1 "
"GROUP BY track.id "
"ORDER BY counter DESC " );
"ORDER BY counter DESC, social_attributes.timestamp DESC " ).arg( m_source->isLocal() ? "IS NULL" : QString( "=%1" ).arg( m_source->id() ) );
break;
case AllLovedTracks:
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' "
"GROUP BY track.id "
"ORDER BY counter DESC " );
"ORDER BY counter DESC, social_attributes.timestamp DESC " );
break;
}