Show
Ignore:
Timestamp:
08/26/08 09:02:11 (4 months ago)
Author:
vollmerk
Message:

fixed two sql queries and the slicing on search (Thx sylvander)

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/lib/class/artist.class.php

    r1670 r1698  
    9090                // If we need to also pull the extra information, this is normally only used when we are doing the human display 
    9191                if ($extra) {  
    92                         $sql = "SELECT `song`.`artist`, COUNT(`song`.`id`) AS `song_count`, COUNT(`song`.`album`) AS `album_count`, SUM(`song`.`time`) AS `time` FROM `song` " . 
     92                        $sql = "SELECT `song`.`artist`, COUNT(`song`.`id`) AS `song_count`, COUNT(DISTINCT `song`.`album`) AS `album_count`, SUM(`song`.`time`) AS `time` FROM `song` " . 
    9393                                "WHERE `song`.`artist` IN $idlist GROUP BY `song`.`artist`"; 
    9494                        $db_results = Dba::query($sql); 
     
    189189                else {  
    190190                        $uid = Dba::escape($this->id);  
    191                         $sql = "SELECT `song`.`artist`,COUNT(`song`.`id`) AS `song_count`, COUNT(`song`.`album`) AS `album_count`, SUM(`song`.`time`) AS `time` FROM `song` " .  
     191                        $sql = "SELECT `song`.`artist`,COUNT(`song`.`id`) AS `song_count`, COUNT(DISTINCT `song`.`album`) AS `album_count`, SUM(`song`.`time`) AS `time` FROM `song` " .  
    192192                                "WHERE `song`.`artist`='$uid' GROUP BY `song`.`artist`"; 
    193193                        $db_results = Dba::query($sql);