Changeset 1675

Show
Ignore:
Timestamp:
08/18/08 21:31:52 (5 months ago)
Author:
vollmerk
Message:

fixed the search a bit, made some random changes to charset and fixed some echo printf() references

Location:
trunk
Files:
8 modified

Legend:

Unmodified
Added
Removed
  • trunk/browse.php

    r1670 r1675  
    5858                $album_ids = Browse::get_objects();  
    5959                Album::build_cache($album_ids,'extra');  
    60                 Browse::show_objects($album_ids);  
     60                Browse::show_objects();  
    6161        break; 
    6262        case 'tag':  
     
    6464                $tags = Browse::get_objects();  
    6565                Tag::build_cache($tags);  
    66                 Browse::show_objects($tags);  
     66                Browse::show_objects();  
    6767        break;  
    6868        case 'artist': 
     
    7070                $artist_ids = Browse::get_objects();  
    7171                Artist::build_cache($artist_ids,'extra');  
    72                 Browse::show_objects($artist_ids);  
     72                Browse::show_objects();  
    7373        break; 
    7474        case 'song': 
     
    7676                $song_ids = Browse::get_objects();  
    7777                Song::build_cache($song_ids);  
    78                 Browse::show_objects($song_ids);  
     78                Browse::show_objects();  
    7979        break; 
    8080        case 'live_stream': 
    8181                Browse::set_sort('name','ASC'); 
    8282                $live_stream_ids = Browse::get_objects();  
    83                 Browse::show_objects($live_stream_ids);  
     83                Browse::show_objects();  
    8484        break; 
    8585        case 'catalog': 
     
    9090                Browse::set_filter('playlist_type','1'); 
    9191                $playlist_ids = Browse::get_objects();  
    92                 Browse::show_objects($playlist_ids);  
     92                Playlist::build_cache($playlist_ids);  
     93                Browse::show_objects();  
    9394        break; 
    9495        default:  
  • trunk/lib/class/browse.class.php

    r1674 r1675  
    177177                 
    178178                // If they pass something then just return that 
    179                 if (is_array($objects)) {  
     179                if (is_array($objects) and !self::is_simple_browse()) {  
    180180                        return count($objects);  
    181181                }  
  • trunk/lib/class/playlist.class.php

    r1515 r1675  
    2424 * This class handles playlists in ampache. it references the playlist* tables 
    2525 */ 
    26 class Playlist {  
     26class Playlist extends database_object {  
    2727 
    2828        /* Variables from the Datbase */ 
     
    4444        public function __construct($id) {  
    4545 
    46                 $this->id       = intval($id); 
    47                 $info           = $this->_get_info(); 
     46                $info           = $this->get_info($id); 
    4847 
    4948                foreach ($info as $key=>$value) {  
     
    5352        } // Playlist 
    5453 
    55         /**  
    56          * _get_info 
    57          * This is an internal (private) function that gathers the information for this object from the  
    58          * playlist_id that was passed in.  
    59          */ 
    60         private function _get_info() {  
    61  
    62                 $sql = "SELECT * FROM `playlist` WHERE `id`='" . Dba::escape($this->id) . "'";   
    63                 $db_results = Dba::query($sql); 
    64  
    65                 $results = Dba::fetch_assoc($db_results); 
    66  
    67                 return $results; 
    68  
    69         } // _get_info 
     54        /** 
     55         * build_cache 
     56         * This is what builds the cache from the objects 
     57         */ 
     58        public static function build_cache($ids) {  
     59 
     60                $idlist = '(' . implode(',',$ids) . ')';  
     61 
     62                $sql = "SELECT * FROM `playlist` WHERE `id` IN $idlist";  
     63                $db_results = Dba::query($sql);  
     64 
     65                while ($row = Dba::fetch_assoc($db_results)) {  
     66                        parent::add_to_cache('playlist',$row['id'],$row);  
     67                }  
     68 
     69        } // build_cache 
    7070 
    7171        /** 
  • trunk/lib/class/vainfo.class.php

    r1659 r1675  
    6969                $this->_getID3->option_extra_info       = false; 
    7070                $this->_getID3->option_tag_lyrics3      = false; 
    71 //              $this->_getID3->encoding                = $this->encoding;  
     71                $this->_getID3->encoding                = $this->encoding;  
    7272                $this->_getID3->option_tags_process    = true;  
    7373 
     
    174174                                break; 
    175175                                case 'id3v2': 
    176                                         $results[$key] = $this->_parse_id3v2($this->_raw['id3v2']['comments']); 
     176                                        $results[$key] = $this->_parse_id3v2($tag_array); 
    177177                                break; 
    178178                                case 'ape': 
     
    357357                                break; 
    358358                                case 'title':  
    359                                         $array['title'] = $this->_clean_tag($data['0'],$this->_raw['id3v2']['TIT2']['0']['encoding']);  
     359                                        $array['title'] = $this->_clean_tag($data['0'],'');  
    360360                                break;  
    361361                                default:  
    362                                         $frame = $this->_id3v2_tag_to_frame($tag); 
    363                                         $encoding = $frame ? $this->_raw['id3v2'][$frame]['0']['encoding'] : '';  
    364                                         $array[$tag]    = $this->_clean_tag($data['0'],$encoding); 
     362                                        $array[$tag]    = $this->_clean_tag($data['0'],''); 
    365363                                break; 
    366364                        } // end switch on tag 
  • trunk/search.php

    r1666 r1675  
    4545                $results = run_search($_REQUEST); 
    4646                Browse::set_type('song');  
     47                Browse::reset();  
    4748                Browse::set_static_content(1); 
    48                 Browse::save_objects($results);  
    49                 Browse::show_objects();  
     49                Browse::show_objects($results);  
    5050        break; 
    5151        case 'save_as_track': 
  • trunk/templates/show_adds_catalog.inc.php

    r1638 r1675  
    22/* 
    33 
    4  Copyright (c) 2001 - 2007 Ampache.org 
     4 Copyright (c) Ampache.org 
    55 All rights reserved. 
    66 
     
    2121 
    2222show_box_top(); 
    23 echo "\n" . printf(_('Starting New Song Search on %s catalog'), " <b>[$this->name]</b> ") . "<br />\n"; 
     23printf(_('Starting New Song Search on %s catalog'), "<strong>[$this->name]</strong>");  
     24echo "<br />\n"; 
    2425echo _('Found') . ": <span id=\"add_count_" . $this->id ."\">" . _('None') . "</span><br />\n"; 
    2526echo _('Reading') . ":<span id=\"add_dir_" . $this->id . "\"></span><br />"; 
  • trunk/templates/show_clean_catalog.inc.php

    r1635 r1675  
    22/* 
    33 
    4  Copyright (c) 2001 - 2007 Ampache.org 
     4 Copyright (c) Ampache.org 
    55 All rights reserved. 
    66 
     
    2222show_box_top(); 
    2323//echo "\n" . _('Cleaning the') . " <b>[" . $this->name . "]</b> " . _('Catalog') . "...<br />\n"; 
    24 echo "\n" . printf(_('Cleaning the %s Catalog'), " <b>[" . $this->name . "]</b> ") . "...<br />\n"; 
     24printf(_('Cleaning the %s Catalog'), "<strong>[" . $this->name . "]</strong>"); 
     25echo "...<br />";  
    2526echo _('Checking') . ": <span id=\"clean_count_" . $this->id . "\"></span>\n<br />"; 
    2627echo _('Reading') . ":<span id=\"clean_dir_" . $this->id . "\"></span><br />"; 
  • trunk/templates/show_verify_catalog.inc.php

    r1635 r1675  
    22/* 
    33 
    4  Copyright (c) 2001 - 2007 Ampache.org 
     4 Copyright (c) Ampache.org 
    55 All rights reserved. 
    66 
     
    2121 
    2222show_box_top(); 
    23 printf(_('Updating the %s catalog', " <b>[ $catalog->name ]</b> ")); 
     23printf(_('Updating the %s catalog', "<strong>[ $catalog->name ]</strong>")); 
    2424echo "<br />\n" . $number . " " . _('songs found checking tag information.') . "<br />\n\n"; 
    2525echo _('Verifed') . ":<span id=\"verify_count_$catalog_id\">$catalog_verify_found</span><br />";