summaryrefslogtreecommitdiffstats
path: root/lib/class
diff options
context:
space:
mode:
Diffstat (limited to 'lib/class')
-rw-r--r--lib/class/artist.class.php4
-rw-r--r--lib/class/browse.class.php2
2 files changed, 3 insertions, 3 deletions
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