🐛 Fix mihomo models update

This commit is contained in:
xtaodada 2024-02-06 22:07:07 +08:00
parent 59e33eb468
commit d8ea564ac9
Signed by: xtaodada
GPG Key ID: 4CBB3F4FA8C85659
2 changed files with 7 additions and 8 deletions

View File

@ -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, []):

View File

@ -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),