diff options
author | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2008-08-26 16:02:11 +0000 |
---|---|---|
committer | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2008-08-26 16:02:11 +0000 |
commit | f54f17453d160932781295632587ef7490136e77 (patch) | |
tree | d36bb4eb65b6de2f567f5c7cd047f45bb9ecced9 /lib/class/artist.class.php | |
parent | eb9e000f3d2fed4b99e3c74916b60ce3ef8d55ff (diff) | |
download | ampache-f54f17453d160932781295632587ef7490136e77.tar.gz ampache-f54f17453d160932781295632587ef7490136e77.tar.bz2 ampache-f54f17453d160932781295632587ef7490136e77.zip |
fixed two sql queries and the slicing on search (Thx sylvander)
Diffstat (limited to 'lib/class/artist.class.php')
-rw-r--r-- | lib/class/artist.class.php | 4 |
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); |