Skip to content

Commit

Permalink
show artist and title
Browse files Browse the repository at this point in the history
  • Loading branch information
tekniklr committed Apr 29, 2016
1 parent f1b8d01 commit fa6155a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 12 deletions.
5 changes: 3 additions & 2 deletions app/views/main/_lastfm.html.haml
@@ -1,8 +1,9 @@
%li
- description = song[:artist] + ' - ' + song[:title]
- if song[:image_url]
= link_to image_tag(song[:image_url], alt: song[:title], title: song[:title]), (song[:amazon_url] ? song[:amazon_url] : song[:lastfm_url])
= link_to image_tag(song[:image_url], alt: description, title: description), (song[:amazon_url] ? song[:amazon_url] : song[:lastfm_url])
- else
= link_to song[:title], song[:lastfm_url]
= link_to description, song[:lastfm_url]
%p{:class => "when fade#{fade}"}
- if song[:published]
= time_ago_in_words(song[:published])+' ago'
22 changes: 12 additions & 10 deletions lib/delayed_job/lastfm_job.rb
Expand Up @@ -21,19 +21,21 @@ def perform
amazon = get_amazon("#{artist} #{album}", 'Music')
if amazon
parsed_items << {
:title => item.name,
:published => played_on,
:image_url => amazon[:image_url],
:amazon_url => amazon[:amazon_url],
:amazon_title => amazon[:amazon_title],
:similarity => amazon[:similarity]
title: item.name,
artist: artist,
published: played_on,
image_url: amazon[:image_url],
amazon_url: amazon[:amazon_url],
amazon_title: amazon[:amazon_title],
similarity: amazon[:similarity]
}
else
parsed_items << {
:title => item.name,
:published => played_on,
:lastfm_url => item.url,
:image_url => image_url,
title: item.name,
artist: artist,
published: played_on,
lastfm_url: item.url,
image_url: image_url,
}
end
end
Expand Down

0 comments on commit fa6155a

Please sign in to comment.