Skip to content

Commit

Permalink
🐛 修复部分情况下抽卡记录数据损失
Browse files Browse the repository at this point in the history
  • Loading branch information
KimigaiiWuyi committed Dec 29, 2024
1 parent cceb2a5 commit 0ce38e9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
8 changes: 8 additions & 0 deletions GenshinUID/genshinuid_gachalog/draw_gachalogs.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from gsuid_core.models import Event
from gsuid_core.logger import logger

from ..utils.map.GS_MAP_PATH import charList
from ..utils.image.convert import convert_img
from .get_gachalogs import all_gacha_type_name
from ..utils.map.name_covert import name_to_avatar_id
Expand Down Expand Up @@ -436,6 +437,13 @@ async def draw_gachalogs_img(uid: str, ev: Event) -> Union[bytes, str]:
item_x = (item_index % 6) * 138 + 60
item_y = (item_index // 6) * 150 + y + 275
xy_point = (item_x, item_y)

if 'item_type' not in item:
if item['item_id'] in charList:
item['item_type'] = '角色'
else:
item['item_type'] = '武器'

tasks.append(
_draw_card(
img,
Expand Down
2 changes: 2 additions & 0 deletions GenshinUID/genshinuid_gachalog/export_and_import.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,12 @@ async def import_data(uid: str, raw_data: List[Dict]):
item['rank_type'] = (
'5' if char_data['rank'] == 'QUALITY_ORANGE' else '4'
)
item['item_type'] = '角色'
else:
weapon_data = weaponList[str(item['item_id'])]
item['name'] = weapon_data['CHS']
item['rank_type'] = str(weapon_data['rank'])
item['item_type'] = '武器'

item['uid'] = uid
item['item_id'] = item['item_id'] if 'item_id' in item else ''
Expand Down

0 comments on commit 0ce38e9

Please sign in to comment.