continue to backport old code

This commit is contained in:
2021-04-24 00:24:05 +02:00
parent 5d7217f355
commit 04434760c5
72 changed files with 795 additions and 78 deletions

View File

@@ -0,0 +1,19 @@
class WowMountsCollectionWorker
include Sidekiq::Worker
def perform(user_id)
# Update the WoW character list
return unless (user = User.find(user_id))
RBattlenet.set_options(locale: 'en_US')
result = RBattlenet::Wow::Profile::MountsCollection.find(user.token)
return unless result.status_code == 200
result.mounts.each do |mount|
next unless (local_mount = WowMount.where(mount_id: mount.mount.id).first)
UserObtainWowMount.where(user: user.id, wow_mount: local_mount.id).first_or_create
end
end
end