From 674a5f6654b25f8273b67deabe495659b9a1f591 Mon Sep 17 00:00:00 2001 From: aidarbek Date: Sat, 26 Dec 2015 19:36:25 +0600 Subject: [PATCH 1/2] Changed names Changed names of XML tags that should be returned when using tag methods. According to http://ws.audioscrobbler.com/2.0, last.fm has changed names of these tags. --- lib/lastfm/method_category/tag.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/lastfm/method_category/tag.rb b/lib/lastfm/method_category/tag.rb index 7d5928c..a03c10d 100644 --- a/lib/lastfm/method_category/tag.rb +++ b/lib/lastfm/method_category/tag.rb @@ -20,7 +20,7 @@ class Tag < Base [:page, nil] ] ) do |response| - response.xml['toptracks']['track'] + response.xml['tracks']['track'] end regular_method( @@ -31,7 +31,7 @@ class Tag < Base [:page, nil] ] ) do |response| - response.xml['topalbums']['album'] + response.xml['albums']['album'] end From 179013c4e2fbea0cf7c2d17168a33f32c8421bb9 Mon Sep 17 00:00:00 2001 From: aidarbek Date: Sat, 26 Dec 2015 20:07:15 +0600 Subject: [PATCH 2/2] Changed tests according to Last.fm API --- spec/fixtures/tag_get_top_albums.xml | 4 ++-- spec/fixtures/tag_get_top_tracks.xml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/spec/fixtures/tag_get_top_albums.xml b/spec/fixtures/tag_get_top_albums.xml index 9c5e941..fb12583 100644 --- a/spec/fixtures/tag_get_top_albums.xml +++ b/spec/fixtures/tag_get_top_albums.xml @@ -1,6 +1,6 @@ - + Number Ones @@ -67,4 +67,4 @@ http://images.amazon.com/images/P/B00002NDAL.01.MZZZZZZZ.jpg http://images.amazon.com/images/P/B00002NDAL.01.MZZZZZZZ.jpg http://images.amazon.com/images/P/B00002NDAL.01.MZZZZZZZ.jpg - + diff --git a/spec/fixtures/tag_get_top_tracks.xml b/spec/fixtures/tag_get_top_tracks.xml index 65889c5..9b85200 100644 --- a/spec/fixtures/tag_get_top_tracks.xml +++ b/spec/fixtures/tag_get_top_tracks.xml @@ -1,6 +1,6 @@ - + Stayin' Alive @@ -97,5 +97,5 @@ http://userserve-ak.last.fm/serve/64s/72573304.png http://userserve-ak.last.fm/serve/126/72573304.png http://userserve-ak.last.fm/serve/300x300/72573304.png - +