diff options
author | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2008-05-26 22:07:26 +0000 |
---|---|---|
committer | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2008-05-26 22:07:26 +0000 |
commit | 5fce261ae2a1fad5a6f1e437a5245a7b1bf981f3 (patch) | |
tree | a7607908104b23e84c4793a0da1a4c79a11258f9 /lib/class/song.class.php | |
parent | fdc509c5c4e2e2256585889ccf0a11a1712f1316 (diff) | |
download | ampache-5fce261ae2a1fad5a6f1e437a5245a7b1bf981f3.tar.gz ampache-5fce261ae2a1fad5a6f1e437a5245a7b1bf981f3.tar.bz2 ampache-5fce261ae2a1fad5a6f1e437a5245a7b1bf981f3.zip |
more improvements to the caching system, removed ugly hack from last night on util
Diffstat (limited to 'lib/class/song.class.php')
-rw-r--r-- | lib/class/song.class.php | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/class/song.class.php b/lib/class/song.class.php index f38c7985..e9e92de6 100644 --- a/lib/class/song.class.php +++ b/lib/class/song.class.php @@ -98,6 +98,7 @@ class Song extends database_object { Artist::build_cache($artists); Album::build_cache($albums); Tag::build_cache($tags); + Tag::build_map_cache('song',$song_ids); // Build a cache for the song's extended table $sql = "SELECT * FROM `song_data` WHERE `song_id` IN $idlist"; @@ -669,6 +670,8 @@ class Song extends database_object { // Get the top tags $tags = Tag::get_top_tags('song',$this->id); + + $this->f_tags = ''; foreach ($tags as $tag_id) { $tag = new Tag($tag_id); $this->f_tags .= $tag->name . ', '; @@ -816,7 +819,11 @@ class Song extends database_object { /* Account for retarded players */ if ($this->type == 'flac') { $type = 'ogg'; } - $this->format(); + // Only reformat if we need to + if (!isset($this->f_title)) { + $this->format(); + } + $song_name = rawurlencode($this->f_artist_full . " - " . $this->title . "." . $type); $web_path = Config::get('web_path'); |