Changeset 10225

Show
Ignore:
Timestamp:
2008-08-13 21:22:25 (4 months ago)
Author:
niklas
Message:

added sorting by artist, releasename in collection page. changed startup.pl to reflect the move of CollectionPreference.pm

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • mb_server/branches/Discographies-BRANCH/cgi-bin/MusicBrainz/Server/CollectionInfo.pm

    r10222 r10225  
    180180    my $rawsql = Sql->new($this->{RAWDBH}); 
    181181     
    182     my $hasReleaseIds = $rawsql->SelectSingleColumnArray('SELECT album FROM collection_has_release_join WHERE collection_info = ?', $this->{collectionId}); 
     182    my $hasReleaseIds = $rawsql->SelectSingleColumnArray('SELECT album FROM collection_has_release_join, artist INNER JOIN artist ON (album.artist = artist.id) WHERE collection_info = ?  ORDER BY artist.name, album.name', $this->{collectionId}); 
    183183     
    184184    return $hasReleaseIds; 
     
    202202     
    203203    # get id's of all releases in collection 
    204     my $result = $rawsql->SelectSingleColumnArray('SELECT album FROM collection_has_release_join WHERE collection_info=?', $this->{collectionId}); 
     204    #my $result = $rawsql->SelectSingleColumnArray('SELECT collection_has_release_join.album FROM collection_has_release_join, album, artist INNER JOIN album ON (collection_has_release_join.album = album.id) INNER JOIN artist ON (album.artist = artist.id) WHERE collection_info = ?', $this->{collectionId}); 
     205    my $result = $rawsql->SelectSingleColumnArray('SELECT album FROM collection_has_release_join WHERE collection_info = ?', $this->{collectionId}); 
    205206     
    206207     
     
    218219            $rosql->Begin(); 
    219220             
    220             my $releaseQuery='SELECT gid FROM album WHERE id IN(' . join(',', @{$result}) . ')'; 
     221            #my $releaseQuery='SELECT gid FROM album WHERE id IN(' . join(',', @{$result}) . ')'; 
     222            my $releaseQuery='SELECT album.gid FROM album INNER JOIN artist ON (album.artist = artist.id) WHERE album.id IN(' . join(',', @{$result}) . ') ORDER BY artist.name, album.name'; 
    221223         
    222224            $mbids = $rosql->SelectListOfLists($releaseQuery);