Skip to content

Commit

Permalink
Revert "Merge branch 'fix_missing_recently_albums' of git://github.co…
Browse files Browse the repository at this point in the history
…m/fcharlier/sonerezh into fcharlier-fix_missing_recently_albums"

This reverts commit 15f4b9f, reversing
changes made to 2cded9d because it introduced
a very very slow query on the database.
  • Loading branch information
lGuillaume124 committed Dec 18, 2016
1 parent 2a13a70 commit 7daf3ea
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions app/Controller/SongsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ public function albums() {
if ($page == 1) {
$latests = $this->Song->find('all', array(
'fields' => array('Song.id', 'Song.band', 'Song.album', 'Song.cover'),
'group' => array('Song.album', 'Song.band'),
'group' => 'Song.album',
'order' => 'Song.created DESC',
'limit' => 6
));
Expand All @@ -246,14 +246,14 @@ public function albums() {
} else {
$subQuery = $db->buildStatement(
array(
'fields' => array('MIN(subsong.id)', 'subsong.album', 'subsong.band'),
'fields' => array('MIN(subsong.id)', 'subsong.album'),
'table' => $db->fullTableName($this->Song),
'alias' => 'subsong',
'group' => array('subsong.album', 'subsong.band')
'group' => 'subsong.album'
),
$this->Song
);
$subQuery = ' (Song.id, Song.album, Song.band) IN (' . $subQuery . ') ';
$subQuery = ' (Song.id, Song.album) IN (' . $subQuery . ') ';

if ($page == 1) {
$latests = $this->Song->find('all', array(
Expand Down

0 comments on commit 7daf3ea

Please sign in to comment.