From 2a9901d2c28f14233c0c331bfd6a5d112d4d229a Mon Sep 17 00:00:00 2001 From: Sahat Yalkabov Date: Tue, 10 Dec 2013 00:36:52 -0500 Subject: [PATCH] Added top albums images on last.fm page --- controllers/api.js | 5 +---- views/api/lastfm.jade | 4 +++- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/controllers/api.js b/controllers/api.js index 9607cfc9be7..d887f783139 100644 --- a/controllers/api.js +++ b/controllers/api.js @@ -213,7 +213,7 @@ exports.getLastfm = function(req, res) { _.each(data.topalbums.album, function(album) { albums.push(album.image.slice(-1)[0]['#text']); }); - done(null, albums); + done(null, albums.slice(0,4)); }, error: function(error) { done(error); @@ -224,9 +224,6 @@ exports.getLastfm = function(req, res) { }, function(err, results) { if (err) return res.send(err); - console.log('===') - console.log(err); - console.log(results); var artist = { name: results.artistInfo.artist.name, image: results.artistInfo.artist.image.slice(-1)[0]['#text'], diff --git a/views/api/lastfm.jade b/views/api/lastfm.jade index 5fa4f60f491..ffc153a55a7 100644 --- a/views/api/lastfm.jade +++ b/views/api/lastfm.jade @@ -28,6 +28,7 @@ block content small.text-primary i.fa.fa-headphones | Scrobbles: #{artist.stats.playcount} + p img(src='#{artist.image}') @@ -45,7 +46,8 @@ block content h4 Top Albums for album in artist.topAlbums - album + img(src='#{album}', width=150, height=150) + |  h4 Similar Artists ul.list