summaryrefslogtreecommitdiffstats
path: root/lib/class
diff options
context:
space:
mode:
authorKarl 'vollmerk' Vollmer <vollmer@ampache.org>2007-07-29 07:21:47 +0000
committerKarl 'vollmerk' Vollmer <vollmer@ampache.org>2007-07-29 07:21:47 +0000
commit755ab35f6b6b0e78bbff6ca24f3f44008d9a4f71 (patch)
treebef53f58330458ed620afd0e9ada526355d99ff7 /lib/class
parentee9999a93074c737ffc298c8370ef05a3121cfa0 (diff)
downloadampache-755ab35f6b6b0e78bbff6ca24f3f44008d9a4f71.tar.gz
ampache-755ab35f6b6b0e78bbff6ca24f3f44008d9a4f71.tar.bz2
ampache-755ab35f6b6b0e78bbff6ca24f3f44008d9a4f71.zip
fixed the album art gathering, enabled art resizing and saving of said stuff... not sure if saving and retriving is saving any time. tweaked show test config wording
Diffstat (limited to 'lib/class')
-rw-r--r--lib/class/album.class.php29
-rw-r--r--lib/class/random.class.php2
2 files changed, 22 insertions, 9 deletions
diff --git a/lib/class/album.class.php b/lib/class/album.class.php
index bc383f7c..62e6ac8c 100644
--- a/lib/class/album.class.php
+++ b/lib/class/album.class.php
@@ -216,7 +216,7 @@ class Album {
$art = $this->get_db_art();
}
- return $art;
+ return $art['0'];
} // get_art
@@ -259,9 +259,9 @@ class Album {
case 'get_amazon_art':
$data = $this->{$method_name}($options['keyword'],$limit);
break;
- case 'get_id3_art':
- $data = $this->{$method_name}($limit);
- break;
+ case 'get_lastfm_art':
+ $data = $this->{$method_name}($limit,$options);
+ break;
default:
$data = $this->{$method_name}($limit);
break;
@@ -288,12 +288,21 @@ class Album {
* This returns the art as pulled from lastFM. This doesn't require
* a special account, we just parse and run with it.
*/
- public function get_lastfm_art($limit) {
+ public function get_lastfm_art($limit,$options='') {
// Create the parser object
$lastfm = new LastFMSearch();
- $raw_data = $lastfm->search($this->artist_name,$this->name);
+ if (is_array($options)) {
+ $artist = $options['artist'];
+ $album = $options['album_name'];
+ }
+ else {
+ $artist = $this->artist_name;
+ $album = $this->name;
+ }
+
+ $raw_data = $lastfm->search($artist,$album);
if (!count($raw_data)) { return array(); }
@@ -446,7 +455,9 @@ class Album {
}
else { return false; }
- return $results;
+ $data = array(array('db_resized'=>$this->id,'raw'=>$results['art'],'mime'=>$results['art_mime']));
+
+ return $data;
} // get_resized_db_art
@@ -462,8 +473,10 @@ class Album {
$results = Dba::fetch_assoc($db_results);
if (!$results['art']) { return array(); }
+
+ $data = array(array('db'=>$this->id,'raw'=>$results['art'],'mime'=>$results['art_mime']));
- return $results;
+ return $data;
} // get_db_art
diff --git a/lib/class/random.class.php b/lib/class/random.class.php
index b24845e8..58be0463 100644
--- a/lib/class/random.class.php
+++ b/lib/class/random.class.php
@@ -32,7 +32,7 @@ class Random {
* Constructor
* nothing to see here, move along
*/
- private function __construct($id) {
+ public function __construct() {
// Rien a faire