amazon-album-art 0.3.2 → 0.3.3
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/amazon-album-art.gemspec +1 -1
- data/lib/amazon-album-art/client.rb +8 -2
- metadata +3 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.3.
|
1
|
+
0.3.3
|
data/amazon-album-art.gemspec
CHANGED
@@ -43,6 +43,7 @@ module AmazonAlbumArt
|
|
43
43
|
results.map("Item") do |match|
|
44
44
|
begin
|
45
45
|
attribs = match['ItemAttributes']
|
46
|
+
puts attribs
|
46
47
|
# grab values that were returned
|
47
48
|
found_artist, found_album = load_artist(attribs), load_album(attribs)
|
48
49
|
rescue StandardError => bang
|
@@ -114,6 +115,7 @@ module AmazonAlbumArt
|
|
114
115
|
|
115
116
|
def load_artist(attribs)
|
116
117
|
# found artists are returned in many different permutations
|
118
|
+
return attribs['Artist'].first if attribs.has_key?('Artist') && attribs['Artist'].is_a?(Array)
|
117
119
|
return attribs['Artist'] if attribs.has_key?('Artist')
|
118
120
|
return attribs['Author'] if attribs.has_key?('Author')
|
119
121
|
return attribs['Creator'].map { |item| item["__content__"] if item.has_key?("__content__") }.join(" and ") if attribs.has_key?("Creator") && attribs['Creator'].is_a?(Array)
|
@@ -135,8 +137,12 @@ module AmazonAlbumArt
|
|
135
137
|
end
|
136
138
|
|
137
139
|
def check_response?(results, msg)
|
138
|
-
|
139
|
-
|
140
|
+
begin
|
141
|
+
return results.valid? || results.find("Error").size == 0
|
142
|
+
rescue StandardError => bang
|
143
|
+
# handled error from Sucker in some cases
|
144
|
+
return false
|
145
|
+
end
|
140
146
|
end
|
141
147
|
end
|
142
148
|
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 3
|
8
|
-
-
|
9
|
-
version: 0.3.
|
8
|
+
- 3
|
9
|
+
version: 0.3.3
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- John Allen
|
@@ -182,7 +182,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
182
182
|
requirements:
|
183
183
|
- - ">="
|
184
184
|
- !ruby/object:Gem::Version
|
185
|
-
hash:
|
185
|
+
hash: -2360168163094758927
|
186
186
|
segments:
|
187
187
|
- 0
|
188
188
|
version: "0"
|