rubocop: fix various issues

This commit is contained in:
lllusion3469
2020-05-11 01:08:18 +02:00
parent 0d5e31868f
commit 70beb7288d
3 changed files with 10 additions and 12 deletions

View File

@@ -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)

View File

@@ -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

View File

@@ -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