Changeset 1698

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

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

Location:
trunk
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • trunk/docs/CHANGELOG

    r1686 r1698  
    55-------------------------------------------------------------------------- 
    66  v.3.5-Alpha1 
     7        - Fixed count issue on browse Artists (Thx Sylvander) 
    78        - Fixed prevent_multiple_logins, preventing all logins (Thx hugh) 
    89        - Fixed Export catalog headers so it corretly prompts you to download 
  • 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); 
  • trunk/lib/class/browse.class.php

    r1681 r1698  
    946946                // Limit is based on the users preferences if this is not a simple browse because we've got too much here 
    947947                if (count($object_ids) > self::$start AND !self::is_simple_browse()) {  
    948                         $object_ids = array_slice($object_ids,self::$start,$limit);  
     948                        $object_ids = array_slice($object_ids,self::$start,self::$offset);  
    949949                }  
    950950