diff options
author | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2008-08-19 04:31:52 +0000 |
---|---|---|
committer | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2008-08-19 04:31:52 +0000 |
commit | a6a8c08e3721962fd2dc5cfdc6efc1803e844a2b (patch) | |
tree | 0a2b14b3029bb3e5bef45af452d10127c0337127 /lib | |
parent | 619368f183a2c652f8ac40a83d847c608187e53d (diff) | |
download | ampache-a6a8c08e3721962fd2dc5cfdc6efc1803e844a2b.tar.gz ampache-a6a8c08e3721962fd2dc5cfdc6efc1803e844a2b.tar.bz2 ampache-a6a8c08e3721962fd2dc5cfdc6efc1803e844a2b.zip |
fixed the search a bit, made some random changes to charset and fixed some echo printf() references
Diffstat (limited to 'lib')
-rw-r--r-- | lib/class/browse.class.php | 2 | ||||
-rw-r--r-- | lib/class/playlist.class.php | 26 | ||||
-rw-r--r-- | lib/class/vainfo.class.php | 10 |
3 files changed, 18 insertions, 20 deletions
diff --git a/lib/class/browse.class.php b/lib/class/browse.class.php index 77d1a81f..68b6bad3 100644 --- a/lib/class/browse.class.php +++ b/lib/class/browse.class.php @@ -176,7 +176,7 @@ class Browse { public static function get_total($objects=false) { // If they pass something then just return that - if (is_array($objects)) { + if (is_array($objects) and !self::is_simple_browse()) { return count($objects); } diff --git a/lib/class/playlist.class.php b/lib/class/playlist.class.php index 02c7d5be..37b645d1 100644 --- a/lib/class/playlist.class.php +++ b/lib/class/playlist.class.php @@ -23,7 +23,7 @@ * Playlist Class * This class handles playlists in ampache. it references the playlist* tables */ -class Playlist { +class Playlist extends database_object { /* Variables from the Datbase */ public $id; @@ -43,8 +43,7 @@ class Playlist { */ public function __construct($id) { - $this->id = intval($id); - $info = $this->_get_info(); + $info = $this->get_info($id); foreach ($info as $key=>$value) { $this->$key = $value; @@ -52,21 +51,22 @@ class Playlist { } // Playlist - /** - * _get_info - * This is an internal (private) function that gathers the information for this object from the - * playlist_id that was passed in. + /** + * build_cache + * This is what builds the cache from the objects */ - private function _get_info() { + public static function build_cache($ids) { - $sql = "SELECT * FROM `playlist` WHERE `id`='" . Dba::escape($this->id) . "'"; - $db_results = Dba::query($sql); + $idlist = '(' . implode(',',$ids) . ')'; - $results = Dba::fetch_assoc($db_results); + $sql = "SELECT * FROM `playlist` WHERE `id` IN $idlist"; + $db_results = Dba::query($sql); - return $results; + while ($row = Dba::fetch_assoc($db_results)) { + parent::add_to_cache('playlist',$row['id'],$row); + } - } // _get_info + } // build_cache /** * format diff --git a/lib/class/vainfo.class.php b/lib/class/vainfo.class.php index 1997a54f..694c19b6 100644 --- a/lib/class/vainfo.class.php +++ b/lib/class/vainfo.class.php @@ -68,7 +68,7 @@ class vainfo { $this->_getID3->option_tags_html = false; $this->_getID3->option_extra_info = false; $this->_getID3->option_tag_lyrics3 = false; -// $this->_getID3->encoding = $this->encoding; + $this->_getID3->encoding = $this->encoding; $this->_getID3->option_tags_process = true; /* Check for ICONV */ @@ -173,7 +173,7 @@ class vainfo { $results[$key] = $this->_parse_id3v1($tag_array); break; case 'id3v2': - $results[$key] = $this->_parse_id3v2($this->_raw['id3v2']['comments']); + $results[$key] = $this->_parse_id3v2($tag_array); break; case 'ape': $results[$key] = $this->_parse_ape($tag_array); @@ -356,12 +356,10 @@ class vainfo { $array['comment'] = $this->_clean_tag($data['0'],''); break; case 'title': - $array['title'] = $this->_clean_tag($data['0'],$this->_raw['id3v2']['TIT2']['0']['encoding']); + $array['title'] = $this->_clean_tag($data['0'],''); break; default: - $frame = $this->_id3v2_tag_to_frame($tag); - $encoding = $frame ? $this->_raw['id3v2'][$frame]['0']['encoding'] : ''; - $array[$tag] = $this->_clean_tag($data['0'],$encoding); + $array[$tag] = $this->_clean_tag($data['0'],''); break; } // end switch on tag |