diff --git a/CHANGELOG.md b/CHANGELOG.md index 01372af..4832085 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ #### Bug / Security fixes: * Merge #215: Playlist title cannot be empty (Thanks to disc) +* Merge #236: Fix missing albums in recently added albums (Thanks to fcharlier) * Fix #207: Broken disc info on OGG files * Fix #199: Improve the message on the cli tool * Fix #196: Error on import when people mess with dates diff --git a/app/Controller/SongsController.php b/app/Controller/SongsController.php index cf4645f..087ebb3 100644 --- a/app/Controller/SongsController.php +++ b/app/Controller/SongsController.php @@ -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' => 'Song.album', + 'group' => array('Song.album', 'Song.band'), 'order' => 'Song.created DESC', 'limit' => 6 )); @@ -246,14 +246,14 @@ public function albums() { } else { $subQuery = $db->buildStatement( array( - 'fields' => array('MIN(subsong.id)', 'subsong.album'), + 'fields' => array('MIN(subsong.id)', 'subsong.album', 'subsong.band'), 'table' => $db->fullTableName($this->Song), 'alias' => 'subsong', - 'group' => 'subsong.album' + 'group' => array('subsong.album', 'subsong.band') ), $this->Song ); - $subQuery = ' (Song.id, Song.album) IN (' . $subQuery . ') '; + $subQuery = ' (Song.id, Song.album, Song.band) IN (' . $subQuery . ') '; if ($page == 1) { $latests = $this->Song->find('all', array(