rubocop: fix various issues
This commit is contained in:
@@ -40,7 +40,7 @@ class DeviantArtApiClient
|
||||
mature_content: mature_content,
|
||||
ext_submission: ext_submission,
|
||||
ext_camera: ext_camera,
|
||||
ext_stats: ext_stats,
|
||||
ext_stats: ext_stats
|
||||
}
|
||||
|
||||
request("deviation/metadata", **params)
|
||||
|
||||
@@ -201,8 +201,6 @@ module Sources
|
||||
end.gsub(/\A[[:space:]]+|[[:space:]]+\z/, "")
|
||||
end
|
||||
|
||||
public
|
||||
|
||||
def self.deviation_id_from_url(url)
|
||||
if url =~ ASSET
|
||||
$~[:base36_deviation_id].try(:to_i, 36)
|
||||
@@ -276,7 +274,7 @@ module Sources
|
||||
|
||||
def api_client
|
||||
api_client = DeviantArtApiClient.new(
|
||||
Danbooru.config.deviantart_client_id,
|
||||
Danbooru.config.deviantart_client_id,
|
||||
Danbooru.config.deviantart_client_secret
|
||||
)
|
||||
api_client.access_token = Cache.get("da-access-token", 11.weeks) do
|
||||
@@ -308,7 +306,7 @@ module Sources
|
||||
{
|
||||
deviation: api_deviation,
|
||||
metadata: api_metadata,
|
||||
download: api_download,
|
||||
download: api_download
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
@@ -40,15 +40,15 @@ module Sources
|
||||
end
|
||||
|
||||
def self.stash_id_from_url(url)
|
||||
if url =~ STASH
|
||||
$~[:post_id].downcase
|
||||
else
|
||||
nil
|
||||
end
|
||||
end
|
||||
if url =~ STASH
|
||||
$~[:post_id].downcase
|
||||
else
|
||||
nil
|
||||
end
|
||||
end
|
||||
|
||||
def stash_id
|
||||
[url, referer_url].map{ |x| self.class.stash_id_from_url(x) }.compact.first
|
||||
[url, referer_url].map { |x| self.class.stash_id_from_url(x) }.compact.first
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user