xunkong / KeqingNiuza

刻记牛杂店
MIT License
516 stars 53 forks source link

导入由genshin-wish-export导出的数据时,报错 #84

Open nil-err opened 2 years ago

nil-err commented 2 years ago

由genshin-wish-export导出Json,使用UIGF2.1格式导出数据,使用刻记牛杂店导入数据时报错。 image

我自己查看导出的Json数据,发现比较早期的抽卡记录数据时没有id这一个值的

Log如下

keqing-220203.txt

Scighost commented 2 years ago

麻烦截个一条记录的图

nil-err commented 2 years ago

{"info":{"uid":"*****","lang":"zh-cn","export_time":1643899733854,"export_app":"genshin-wish-export","export_app_version":"0.8.1","uigf_version":"2.1"},"list":[{"gacha_type":"301","time":"2020-10-02 19:42:52","name":"香菱","item_type":"角色","rank_type":"4","id":"","uigf_gacha_type":"301"},{"gacha_type":"301","time":"2020-10-02 19:42:52","name":"菲谢尔","item_type":"角色","rank_type":"4","id":"","uigf_gacha_type":"301"},{"gacha_type":"301","time":"2020-10-02 19:42:52","name":"飞天御剑","item_type":"武器","rank_type":"3","id":"","uigf_gacha_type":"301"},{"gacha_type":"301","time":"2020-10-02 19:42:52","name":"翡玉法球","item_type":"武器","rank_type":"3","id":"","uigf_gacha_type":"301"},{"gacha_type":"301","time":"2020-10-02 19:42:52","name":"菲谢尔","item_type":"角色","rank_type":"4","id":"","uigf_gacha_type":"301"},{"gacha_type":"301","time":"2020-10-02 19:42:52","name":"弹弓","item_type":"武器","rank_type":"3","id":"","uigf_gacha_type":"301"},{"gacha_type":"301","time":"2020-10-02 19:42:52","name":"冷刃","item_type":"武器","rank_type":"3","id":"","uigf_gacha_type":"301"},{"gacha_type":"301","time":"2020-10-02 19:42:52","name":"铁影阔剑","item_type":"武器","rank_type":"3","id":"","uigf_gacha_type":"301"},{"gacha_type":"301","time":"2020-10-02 19:42:52","name":"魔导绪论","item_type":"武器","rank_type":"3","id":"","uigf_gacha_type":"301"},{"gacha_type":"301","time":"2020-10-02 19:42:52","name":"以理服人","item_type":"武器","rank_type":"3","id":"","uigf_gacha_type":"301"},{"gacha_type":"301","time":"2020-10-02 19:44:29","name":"香菱","item_type":"角色","rank_type":"4","id":"","uigf_gacha_type":"301"},{"gacha_type":"301","time":"2020-10-02 19:44:29","name":"冷刃","item_type":"武器","rank_type":"3","id":"","uigf_gacha_type":"301"},{"gacha_type":"301","time":"2020-10-02 19:44:29","name":"沐浴龙血的剑","item_type":"武器","rank_type":"3","id":"","uigf_gacha_type":"301"},{"gacha_type":"301","time":"2020-10-02 19:44:29","name":"铁影阔剑","item_type":"武器","rank_type":"3","id":"","uigf_gacha_type":"301"},{"gacha_type":"301","time":"2020-10-02 19:44:29","name":"飞天御剑","item_type":"武器","rank_type":"3","id":"","uigf_gacha_type":"301"},{"gacha_type":"301","time":"2020-10-02 19:44:29","name":"魔导绪论","item_type":"武器","rank_type":"3","id":"","uigf_gacha_type":"301"},{"gacha_type":"301","time":"2020-10-02 19:44:29","name":"黑缨枪","item_type":"武器","rank_type":"3","id":"","uigf_gacha_type":"301"},{"gacha_type":"301","time":"2020-10-02 19:44:29","name":"冷刃","item_type":"武器","rank_type":"3","id":"","uigf_gacha_type":"301"},{"gacha_type":"301","time":"2020-10-02 19:44:29","name":"冷刃","item_type":"武器","rank_type":"3","id":"","uigf_gacha_type":"301"},{"gacha_type":"301","time":"2020-10-02 19:44:29","name":"雨裁","item_type":"武器","rank_type":"4","id":"","uigf_gacha_type":"301"},{"gacha_type":"301","time":"2020-10-02 19:46:20","name":"鸦羽弓","item_type":"武器","rank_type":"3","id":"","uigf_gacha_type":"301"},

nil-err commented 2 years ago

这是比较早期没有抽卡id的记录

nil-err commented 2 years ago

{"gacha_type":"301","time":"2021-11-02 18:00:43","name":"黑缨枪","item_type":"武器","rank_type":"3","id":"1635847560004909242","uigf_gacha_type":"301"},{"gacha_type":"301","time":"2021-11-02 18:00:49","name":"铁影阔剑","item_type":"武器","rank_type":"3","id":"1635847560005872904","uigf_gacha_type":"301"},{"gacha_type":"301","time":"2021-11-02 18:00:49","name":"黎明神剑","item_type":"武器","rank_type":"3","id":"1635847560005872905","uigf_gacha_type":"301"},

nil-err commented 2 years ago

后期有id的记录

Scighost commented 2 years ago

有 id 字段但是值为空,会导致转化为int64时出现错误。 先做好备份,然后手动补上0(内容为0的字符串),应该可以解决问题。

(能合并成一条就别分开发,你这一下子给我发了4封通知邮件)

nil-err commented 2 years ago

谢谢,打扰到你了很抱歉 你提出的手动补id值的方案是有效的,但是不能补相同值,会被去重。 目前我是自己python处理了一下,能导入了,数据没问题。 但是如果可以的话,还是希望你能考虑在下一版本处理一下这个问题。 谢谢你