sources: replace HttpartyCache with Danbooru::Http.

This commit is contained in:
evazion
2019-12-15 15:40:30 -06:00
parent 0adec60259
commit 41378bc8e3
7 changed files with 35 additions and 56 deletions

View File

@@ -101,8 +101,8 @@ module Sources
return {}
end
body, code = HttpartyCache.get("/post.json", base_uri: "https://#{site_name}", params: params)
post = JSON.parse(body, symbolize_names: true).first
response = Danbooru::Http.cache(1.minute).get("https://#{site_name}/post.json", params: params)
post = response.parse.first&.with_indifferent_access
post || {}
end
memoize :api_response