修复 gacha 默认角色卡池失效

This commit is contained in:
omg-xtao 2022-07-18 15:57:52 +08:00 committed by GitHub
parent ba3f936558
commit 18ac3da615
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -13,10 +13,13 @@ class GachaService:
gacha_list_info = await self.gacha.get_gacha_list_info()
gacha_id = ""
for gacha in gacha_list_info.data["list"]:
if gacha["gacha_name"] == gacha_name or default:
if gacha["gacha_name"] == gacha_name:
gacha_id = gacha["gacha_id"]
if gacha_id == "":
return {}
if default and len(gacha_list_info.data["list"]) > 0:
gacha_id = gacha_list_info.data["list"][0]["gacha_id"]
else:
return {}
gacha_info = await self.gacha.get_gacha_info(gacha_id)
gacha_info["gacha_id"] = gacha_id
return gacha_info