summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorKarl 'vollmerk' Vollmer <vollmer@ampache.org>2006-12-31 23:16:58 +0000
committerKarl 'vollmerk' Vollmer <vollmer@ampache.org>2006-12-31 23:16:58 +0000
commit3ac90131cee1432d8278cdeff47961a50d8c7125 (patch)
treef9854f3bd5e4f174704ab1b804c0b26e4910368b /lib
parenta145e33a37948eda1d83e0272ee46faf6148d0e7 (diff)
downloadampache-3ac90131cee1432d8278cdeff47961a50d8c7125.tar.gz
ampache-3ac90131cee1432d8278cdeff47961a50d8c7125.tar.bz2
ampache-3ac90131cee1432d8278cdeff47961a50d8c7125.zip
* Updated CSS to improve compatibiliy and make appearance more consistant (Thx Spocky)
* Fixed some issues with the Amazon Album art gathering created when I re-wrote it
Diffstat (limited to 'lib')
-rw-r--r--lib/album.lib.php2
-rw-r--r--lib/class/album.class.php17
2 files changed, 14 insertions, 5 deletions
diff --git a/lib/album.lib.php b/lib/album.lib.php
index 891c1b24..d01691b2 100644
--- a/lib/album.lib.php
+++ b/lib/album.lib.php
@@ -43,7 +43,7 @@ function get_image_from_source($data) {
// Check to see if it's a URL
if (isset($data['url'])) {
$snoopy = new Snoopy();
- $snoopy->fetch($results['url']);
+ $snoopy->fetch($data['url']);
return $snoopy->results;
}
diff --git a/lib/class/album.class.php b/lib/class/album.class.php
index 6ef08f7a..49a24b1b 100644
--- a/lib/class/album.class.php
+++ b/lib/class/album.class.php
@@ -226,7 +226,7 @@ class Album {
// Some of these take options!
switch ($method_name) {
case 'get_amazon_art':
- $data = $this->{$method_name}($options['keyword']);
+ $data = $this->{$method_name}($options['keyword'],$limit);
break;
case 'get_id3_art':
$data = $this->{$method_name}($limit);
@@ -371,7 +371,7 @@ class Album {
* This takes keywords and performs a search of the Amazon website
* for album art. It returns an array of found objects with mime/url keys
*/
- function get_amazon_art($keywords = '') {
+ function get_amazon_art($keywords = '',$limit='') {
$images = array();
$final_results = array();
@@ -440,12 +440,15 @@ class Album {
} // foreach
// Rudimentary image type detection, only JPG and GIF allowed.
- if (substr($result[$key], -4 == ".jpg")) {
+ if (substr($result[$key], -4 == '.jpg')) {
$mime = "image/jpg";
}
- elseif (substr($result[$key], -4 == ".gif")) {
+ elseif (substr($result[$key], -4 == '.gif')) {
$mime = "image/gif";
}
+ elseif (substr($result[$key], -4 == '.png')) {
+ $mime = "image/png";
+ }
else {
/* Just go to the next result */
continue;
@@ -456,6 +459,12 @@ class Album {
$images[] = $data;
+ if (!empty($limit)) {
+ if (count($images) >= $limit) {
+ return $images;
+ }
+ }
+
} // if we've got something
return $images;