diff options
-rwxr-xr-x | docs/CHANGELOG | 1 | ||||
-rw-r--r-- | lib/class/artist.class.php | 4 | ||||
-rw-r--r-- | lib/class/browse.class.php | 2 |
3 files changed, 4 insertions, 3 deletions
diff --git a/docs/CHANGELOG b/docs/CHANGELOG index 9b3a3a8b..4d8e0b6a 100755 --- a/docs/CHANGELOG +++ b/docs/CHANGELOG @@ -4,6 +4,7 @@ -------------------------------------------------------------------------- v.3.5-Alpha1 + - Fixed count issue on browse Artists (Thx Sylvander) - Fixed prevent_multiple_logins, preventing all logins (Thx hugh) - Fixed Export catalog headers so it corretly prompts you to download the file diff --git a/lib/class/artist.class.php b/lib/class/artist.class.php index 7a52afaf..1b72d7df 100644 --- a/lib/class/artist.class.php +++ b/lib/class/artist.class.php @@ -89,7 +89,7 @@ class Artist extends database_object { // If we need to also pull the extra information, this is normally only used when we are doing the human display if ($extra) { - $sql = "SELECT `song`.`artist`, COUNT(`song`.`id`) AS `song_count`, COUNT(`song`.`album`) AS `album_count`, SUM(`song`.`time`) AS `time` FROM `song` " . + $sql = "SELECT `song`.`artist`, COUNT(`song`.`id`) AS `song_count`, COUNT(DISTINCT `song`.`album`) AS `album_count`, SUM(`song`.`time`) AS `time` FROM `song` " . "WHERE `song`.`artist` IN $idlist GROUP BY `song`.`artist`"; $db_results = Dba::query($sql); @@ -188,7 +188,7 @@ class Artist extends database_object { } else { $uid = Dba::escape($this->id); - $sql = "SELECT `song`.`artist`,COUNT(`song`.`id`) AS `song_count`, COUNT(`song`.`album`) AS `album_count`, SUM(`song`.`time`) AS `time` FROM `song` " . + $sql = "SELECT `song`.`artist`,COUNT(`song`.`id`) AS `song_count`, COUNT(DISTINCT `song`.`album`) AS `album_count`, SUM(`song`.`time`) AS `time` FROM `song` " . "WHERE `song`.`artist`='$uid' GROUP BY `song`.`artist`"; $db_results = Dba::query($sql); $row = Dba::fetch_assoc($db_results); diff --git a/lib/class/browse.class.php b/lib/class/browse.class.php index fd635d20..af8ddc03 100644 --- a/lib/class/browse.class.php +++ b/lib/class/browse.class.php @@ -945,7 +945,7 @@ class Browse { // Limit is based on the users preferences if this is not a simple browse because we've got too much here if (count($object_ids) > self::$start AND !self::is_simple_browse()) { - $object_ids = array_slice($object_ids,self::$start,$limit); + $object_ids = array_slice($object_ids,self::$start,self::$offset); } // Format any matches we have so we can show them to the masses |