lib/ayadn/nowplaying.rb in ayadn-1.6.0 vs lib/ayadn/nowplaying.rb in ayadn-1.7.0
- old
+ new
@@ -58,39 +58,40 @@
def post_nowplaying text_to_post, store, options
begin
@view.clear_screen
puts Status.writing
show_nowplaying("\n#{text_to_post}", options, store)
- unless options['no_url'] || store.nil?
+ unless options[:no_url] || store.nil?
text_to_post += "\n \n[iTunes Store](#{store['link']})"
end
abort(Status.canceled) unless STDIN.getch == ("y" || "Y")
puts "\n#{Status.yourpost}"
- unless store.nil? || options['no_url']
+ unless store.nil? || options[:no_url]
visible, track, artwork, artwork_thumb, link, artist = true, store['track'], store['artwork'], store['artwork_thumb'], store['link'], store['artist']
else
visible, track, artwork, artwork_thumb, link, artist = false
end
- if options['lastfm']
+ if options[:lastfm]
source = 'Last.fm'
else
source = 'iTunes'
end
dic = {
- 'text' => text_to_post,
- 'title' => track,
- 'artist' => artist,
- 'artwork' => artwork,
- 'artwork_thumb' => artwork_thumb,
- 'width' => 1200,
- 'height' => 1200,
- 'width_thumb' => 200,
- 'height_thumb' => 200,
- 'link' => link,
- 'source' => source,
- 'visible' => visible
+ options: options,
+ text: text_to_post,
+ title: track,
+ artist: artist,
+ artwork: artwork,
+ artwork_thumb: artwork_thumb,
+ width: 1200,
+ height: 1200,
+ width_thumb: 200,
+ height_thumb: 200,
+ link: link,
+ source: source,
+ visible: visible
}
- @view.show_posted(Post.new.send_nowplaying(dic))
+ @view.show_posted(Post.new.post(dic))
rescue => e
puts Status.wtf
Errors.global_error({error: e, caller: caller, data: [dic, store, options]})
end
end