summaryrefslogtreecommitdiffstats
path: root/lib/class
diff options
context:
space:
mode:
authorKarl 'vollmerk' Vollmer <vollmer@ampache.org>2007-07-29 05:34:21 +0000
committerKarl 'vollmerk' Vollmer <vollmer@ampache.org>2007-07-29 05:34:21 +0000
commited04606a52c31c951c766aca152ca91c138fbbf1 (patch)
tree0c427e3901d50e5cdba6ec013d942615af6b62ee /lib/class
parent258e4fcdf22745ce2b119df63458790461a6fbf0 (diff)
downloadampache-ed04606a52c31c951c766aca152ca91c138fbbf1.tar.gz
ampache-ed04606a52c31c951c766aca152ca91c138fbbf1.tar.bz2
ampache-ed04606a52c31c951c766aca152ca91c138fbbf1.zip
slightly improved the logic on pulling albums, fixed a typo causing find album art not to work as advertised
Diffstat (limited to 'lib/class')
-rw-r--r--lib/class/album.class.php2
-rw-r--r--lib/class/catalog.class.php9
2 files changed, 8 insertions, 3 deletions
diff --git a/lib/class/album.class.php b/lib/class/album.class.php
index fc54f390..bc383f7c 100644
--- a/lib/class/album.class.php
+++ b/lib/class/album.class.php
@@ -300,6 +300,7 @@ class Album {
$coverart = $raw_data['coverart'];
ksort($coverart);
+
foreach ($coverart as $key=>$value) {
$i++;
$url = $coverart[$key];
@@ -310,7 +311,6 @@ class Album {
} // end foreach
return $data;
-
} // get_lastfm_art
/*!
diff --git a/lib/class/catalog.class.php b/lib/class/catalog.class.php
index 1e58642e..81bf8873 100644
--- a/lib/class/catalog.class.php
+++ b/lib/class/catalog.class.php
@@ -515,11 +515,16 @@ class Catalog {
// Return results
$results = $album->find_art($options,1);
-
+
if (count($results)) {
// Pull the string representation from the source
$image = get_image_from_source($results['0']);
- $album->insert_art($image,$results['0']['mime']);
+ if (strlen($image) > '5') {
+ $album->insert_art($image,$results['0']['mime']);
+ }
+ else {
+ debug_event('album_art','Image less then 5 chars, not inserting','3');
+ }
$art_found++;
}