Compare commits
No commits in common. "3ea0842f008f26023ed0c75f809aa2f8835d8c0a" and "d6888f19412464068bbfbdc7bebb930156022456" have entirely different histories.
3ea0842f00
...
d6888f1941
1 changed files with 1 additions and 8 deletions
|
@ -35,11 +35,7 @@ class Pet < ApplicationRecord
|
||||||
color_id: pet_data[:color_id].to_i
|
color_id: pet_data[:color_id].to_i
|
||||||
)
|
)
|
||||||
|
|
||||||
begin
|
new_image_hash = Pet.fetch_image_hash(self.name)
|
||||||
new_image_hash = Pet.fetch_image_hash(self.name)
|
|
||||||
rescue => error
|
|
||||||
Rails.logger.warn "Failed to load image hash: #{error.full_message}"
|
|
||||||
end
|
|
||||||
self.pet_type.image_hash = new_image_hash if new_image_hash.present?
|
self.pet_type.image_hash = new_image_hash if new_image_hash.present?
|
||||||
|
|
||||||
# With an alt style, `body_id` in the biology data refers to the body ID of
|
# With an alt style, `body_id` in the biology data refers to the body ID of
|
||||||
|
@ -137,9 +133,6 @@ class Pet < ApplicationRecord
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.fetch_metadata(name, timeout: 10)
|
def self.fetch_metadata(name, timeout: 10)
|
||||||
# If this is an image hash "pet name", it has no metadata.
|
|
||||||
return nil if name.start_with?("@")
|
|
||||||
|
|
||||||
request = PET_SERVICE.action('getPet').request([name])
|
request = PET_SERVICE.action('getPet').request([name])
|
||||||
send_amfphp_request(request).tap do |data|
|
send_amfphp_request(request).tap do |data|
|
||||||
if data[:name].blank?
|
if data[:name].blank?
|
||||||
|
|
Loading…
Reference in a new issue