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