summaryrefslogtreecommitdiffstats
path: root/artists.php
diff options
context:
space:
mode:
authorPaul 'flowerysong' Arthur <flowerysong00@yahoo.com>2010-08-17 20:59:16 +0000
committerPaul 'flowerysong' Arthur <flowerysong00@yahoo.com>2010-08-17 20:59:16 +0000
commitdf80bd72432011010dc0e91ab564659ca6b2c500 (patch)
treec68f957da32a382bf3a542b7e7f3e54b886483ca /artists.php
parent34d1449660437c2ea24dd55989efebf4e01d485f (diff)
downloadampache-df80bd72432011010dc0e91ab564659ca6b2c500.tar.gz
ampache-df80bd72432011010dc0e91ab564659ca6b2c500.tar.bz2
ampache-df80bd72432011010dc0e91ab564659ca6b2c500.zip
Refactored Last.FM recommendations; drop new dependency on curl since
Snoopy works just as well for this application.
Diffstat (limited to 'artists.php')
-rw-r--r--artists.php17
1 files changed, 8 insertions, 9 deletions
diff --git a/artists.php b/artists.php
index ea9cb414..d8fb1d91 100644
--- a/artists.php
+++ b/artists.php
@@ -34,6 +34,14 @@ switch($_REQUEST['action']) {
$object_ids = $artist->get_albums();
$object_type = 'album';
require_once Config::get('prefix') . '/templates/show_artist.inc.php';
+ if (Config::get('lastfm_api_key')) {
+ if ($object_ids = Recommendation::get_artists_like($artist->id)) {
+ // Ugly code to grab the relevant entries.
+ // Almost looks like Perl.
+ $object_ids = array_map(create_function('$i', 'return $i[\'id\'];'), $object_ids);
+ require_once Config::get('prefix') . '/templates/show_recommended_artists.inc.php';
+ }
+ }
break;
case 'show_all_songs':
$artist = new Artist($_REQUEST['artist']);
@@ -42,15 +50,6 @@ switch($_REQUEST['action']) {
$object_ids = $artist->get_songs();
require_once Config::get('prefix') . '/templates/show_artist.inc.php';
break;
-
- case 'show_like':
- $artist = new Artist($_REQUEST['artist']);
- $artist->format();
- $object_type = 'artist';
- $object_ids = $artist->get_like();
- require_once Config::get('prefix') . '/templates/show_artist.inc.php';
- break;
-
case 'update_from_tags':
$type = 'artist';