summaryrefslogtreecommitdiffstats
path: root/lib/class/album.class.php
diff options
context:
space:
mode:
authorKarl 'vollmerk' Vollmer <vollmer@ampache.org>2009-03-15 16:16:04 +0000
committerKarl 'vollmerk' Vollmer <vollmer@ampache.org>2009-03-15 16:16:04 +0000
commitfdb7c58cb160c5f8f0f0327c11cba93226e062f6 (patch)
tree6cf57a740799a3a9b9dc9a035ccb66e1e54b053f /lib/class/album.class.php
parent86ff429b366080b9203e5ddb1740339c64013853 (diff)
downloadampache-fdb7c58cb160c5f8f0f0327c11cba93226e062f6.tar.gz
ampache-fdb7c58cb160c5f8f0f0327c11cba93226e062f6.tar.bz2
ampache-fdb7c58cb160c5f8f0f0327c11cba93226e062f6.zip
fix typo causing height to not display on art retrival, update to db allowing gc of tmp_browse, add extension to api album art image urls
Diffstat (limited to 'lib/class/album.class.php')
-rw-r--r--lib/class/album.class.php34
1 files changed, 34 insertions, 0 deletions
diff --git a/lib/class/album.class.php b/lib/class/album.class.php
index 438a9033..017e8147 100644
--- a/lib/class/album.class.php
+++ b/lib/class/album.class.php
@@ -959,6 +959,40 @@ class Album extends database_object {
} // get_image_from_source
+ /**
+ * get_art_url
+ * This returns the art URL for the album
+ */
+ public static function get_art_url($album_id,$sid=false) {
+
+ $sid = $sid ? scrub_out($sid) : session_id();
+
+ $sql = "SELECT `art_mime`,`thumb_mime` FROM `album_data` WHERE `album_id`='" . Dba::escape($album_id) . "'";
+ $db_results = Dba::read($sql);
+
+ $row = Dba::fetch_assoc($db_results);
+
+ $mime = $row['thumb_mime'] ? $row['thumb_mime'] : $row['art_mime'];
+
+ switch ($type) {
+ case 'image/gif':
+ $type = 'gif';
+ break;
+ case 'image/png':
+ $type = 'png';
+ break;
+ default:
+ case 'image/jpeg':
+ $type = 'jpg';
+ break;
+ } // end type translation
+
+ $name = 'art.' . $type;
+
+ Config::get('web_path') . '/image.php?id=' . scrub_out($album_id) . '&auth=' . $sid . '&name=' . $name;
+
+ } // get_art_url
+
} //end of album class
?>