artstation: include only images in image_urls.

This commit is contained in:
evazion
2017-06-06 13:07:10 -05:00
parent 215569fbe0
commit b1171306a1
2 changed files with 14 additions and 1 deletions

View File

@@ -54,7 +54,8 @@ module Sources::Strategies
@json = JSON.parse(resp.body)
@artist_name = json["user"]["username"]
@profile_url = json["user"]["permalink"]
@image_urls = json["assets"].map do |x|
images = json["assets"].select { |asset| asset["asset_type"] == "image" }
@image_urls = images.map do |x|
y, _, _ = image_url_rewriter.rewrite(x["image_url"], nil)
y
end