Added top albums images on last.fm page
This commit is contained in:
@ -213,7 +213,7 @@ exports.getLastfm = function(req, res) {
|
|||||||
_.each(data.topalbums.album, function(album) {
|
_.each(data.topalbums.album, function(album) {
|
||||||
albums.push(album.image.slice(-1)[0]['#text']);
|
albums.push(album.image.slice(-1)[0]['#text']);
|
||||||
});
|
});
|
||||||
done(null, albums);
|
done(null, albums.slice(0,4));
|
||||||
},
|
},
|
||||||
error: function(error) {
|
error: function(error) {
|
||||||
done(error);
|
done(error);
|
||||||
@ -224,9 +224,6 @@ exports.getLastfm = function(req, res) {
|
|||||||
},
|
},
|
||||||
function(err, results) {
|
function(err, results) {
|
||||||
if (err) return res.send(err);
|
if (err) return res.send(err);
|
||||||
console.log('===')
|
|
||||||
console.log(err);
|
|
||||||
console.log(results);
|
|
||||||
var artist = {
|
var artist = {
|
||||||
name: results.artistInfo.artist.name,
|
name: results.artistInfo.artist.name,
|
||||||
image: results.artistInfo.artist.image.slice(-1)[0]['#text'],
|
image: results.artistInfo.artist.image.slice(-1)[0]['#text'],
|
||||||
|
@ -28,6 +28,7 @@ block content
|
|||||||
small.text-primary
|
small.text-primary
|
||||||
i.fa.fa-headphones
|
i.fa.fa-headphones
|
||||||
| Scrobbles: #{artist.stats.playcount}
|
| Scrobbles: #{artist.stats.playcount}
|
||||||
|
|
||||||
p
|
p
|
||||||
img(src='#{artist.image}')
|
img(src='#{artist.image}')
|
||||||
|
|
||||||
@ -45,7 +46,8 @@ block content
|
|||||||
|
|
||||||
h4 Top Albums
|
h4 Top Albums
|
||||||
for album in artist.topAlbums
|
for album in artist.topAlbums
|
||||||
album
|
img(src='#{album}', width=150, height=150)
|
||||||
|
|
|
||||||
|
|
||||||
h4 Similar Artists
|
h4 Similar Artists
|
||||||
ul.list
|
ul.list
|
||||||
|
Reference in New Issue
Block a user