🐛 修复导入 xlsx 时 uid 为 0, 物品类型都为武器的 bug

This commit is contained in:
SiHuan 2022-10-21 16:30:09 +08:00
parent e6c25aaa98
commit 333994281e
No known key found for this signature in database
GPG Key ID: 6D484EBFDD2ED6BA
2 changed files with 5 additions and 3 deletions

View File

@ -268,8 +268,10 @@ class GachaLog:
) -> Tuple[bool, str]:
new_num = 0
try:
if not verify_uid:
data["info"]["uid"] = str(client.uid)
uid = data["info"]["uid"]
if verify_uid and int(uid) != client.uid:
if int(uid) != client.uid:
raise GachaLogAccountNotFound
# 检查导入数据是否合法
all_items = [GachaItem(**i) for i in data["list"]]

View File

@ -130,14 +130,14 @@ class GachaLog(Plugin.Conversation, BasePlugin.Conversation):
}
def from_paimon_moe(uigf_gacha_type: UIGFGachaType, item_type: str, name: str, time: str, p: int) -> Qiyr:
item_type = ItemType.CHARACTER if type == "Character" else ItemType.WEAPON
item_type = ItemType.CHARACTER if item_type == "Character" else ItemType.WEAPON
name = zh_dict[name]
time = datetime.strptime(time, "%Y-%m-%d %H:%M:%S")
return Qiyr(uigf_gacha_type, item_type, name, time, p, 0)
def from_fxq(uigf_gacha_type: UIGFGachaType, item_type: str, name: str, time: str, p: int, _id: int) -> Qiyr:
item_type = ItemType.CHARACTER if type == "角色" else ItemType.WEAPON
item_type = ItemType.CHARACTER if item_type == "角色" else ItemType.WEAPON
time = datetime.strptime(time, "%Y-%m-%d %H:%M:%S")
return Qiyr(uigf_gacha_type, item_type, name, time, p, _id)