From d8ea564ac9a5a4ad6d7c7dd3b8a5a5024c97db1c Mon Sep 17 00:00:00 2001 From: xtaodada Date: Tue, 6 Feb 2024 22:07:07 +0800 Subject: [PATCH] :bug: Fix mihomo models update --- modules/playercards/file.py | 13 ++++++------- plugins/starrail/player_cards.py | 2 +- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/modules/playercards/file.py b/modules/playercards/file.py index e0111e1..649ee88 100644 --- a/modules/playercards/file.py +++ b/modules/playercards/file.py @@ -61,7 +61,7 @@ class PlayerCardsFile: data: Dict, props: Dict, ) -> Dict: - assistAvatarDetail = "assistAvatarDetail" + assistAvatarList = "assistAvatarList" avatarId = "avatarId" avatarDetailList = "avatarDetailList" avatarList = "avatarList" @@ -71,18 +71,17 @@ class PlayerCardsFile: old_data = {} avatars = [] avatar_ids = [] - assist_avatar = data.get(assistAvatarDetail, None) - if assist_avatar: - avatars.append(assist_avatar) - avatar_ids.append(assist_avatar.get(avatarId, 0)) + for avatar in data.get(assistAvatarList, []): + avatars.append(avatar) + avatar_ids.append(avatar.get(avatarId, 0)) for avatar in data.get(avatarDetailList, []): if avatar.get(avatarId, 0) in avatar_ids: continue avatars.append(avatar) avatar_ids.append(avatar.get(avatarId, 0)) data[avatarList] = avatars - if assistAvatarDetail in data: - del data[assistAvatarDetail] + if assistAvatarList in data: + del data[assistAvatarList] if avatarDetailList in data: del data[avatarDetailList] for i in old_data.get(avatarList, []): diff --git a/plugins/starrail/player_cards.py b/plugins/starrail/player_cards.py index 9608d80..c8fdf23 100644 --- a/plugins/starrail/player_cards.py +++ b/plugins/starrail/player_cards.py @@ -368,7 +368,7 @@ class PlayerCards(Plugin): ) except AssetsCouldNotFound: logger.warning("角色 %s 的头像资源获取失败", cid) - if idx > 3: + if idx == 7: break return { "uid": mask_number(data.uid),