diff --git a/gram_core b/gram_core index fb76a75..42ce49e 160000 --- a/gram_core +++ b/gram_core @@ -1 +1 @@ -Subproject commit fb76a75ee1d10eb3c7c52abccde7f15a94726386 +Subproject commit 42ce49e834dfd4ca59f2f1e59145a0785052c85b diff --git a/plugins/tools/player_info.py b/plugins/tools/player_info.py index fa70da6..92a6446 100644 --- a/plugins/tools/player_info.py +++ b/plugins/tools/player_info.py @@ -60,13 +60,16 @@ class PlayerInfoSystem(Plugin): level=0, ) - async def update_player_info(self, player: "Player", nickname: str, level: int): + async def update_player_info(self, player: "Player", base_info: "PlayerAvatarInfo"): player_info = await self.player_info_service.get_form_sql(player) if player_info is not None and player_info.create_time is not None: - player_info.nickname = nickname - if player_info.extra_data is None: - player_info.extra_data = ExtraPlayerInfo() - player_info.extra_data.level = level + player_info.nickname = base_info.nickname + ex = player_info.extra_data + player_info.extra_data = ExtraPlayerInfo() + if ex is not None: + ex.copy_to(player_info.extra_data) + player_info.extra_data.level = base_info.level + player_info.extra_data.avatar = base_info.avatar await self.player_info_service.update(player_info) async def get_player_info_by_cookie(self, player: "Player", user_name: str) -> PlayerAvatarInfo: @@ -75,10 +78,14 @@ class PlayerInfoSystem(Plugin): async with self.helper.genshin(player.user_id, player_id=player.player_id) as client: client: "ZZZClient" record_card = await client.get_record_card() + index = await client.get_zzz_user() if record_card is not None: base_info.nickname = record_card.nickname base_info.level = record_card.level - await self.update_player_info(player, base_info.nickname, base_info.level) + if index is not None: + base_info.avatar = index.cur_head_icon_url + if base_info.level: + await self.update_player_info(player, base_info) except Exception as e: logger.warning("卡片信息通过 cookie 请求失败 %s", str(e)) return base_info @@ -103,8 +110,9 @@ class PlayerInfoSystem(Plugin): ): base_info = await self.get_player_info_by_cookie(player, player_info.nickname) else: - base_info.nickname = player_info.nickname - base_info.level = player_info.extra_data.level + base_info.nickname = player_info.nickname or "" + base_info.avatar = player_info.extra_data.avatar or base_info.avatar + base_info.level = player_info.extra_data.level or 0 await self.set_form_cache(base_info) return base_info diff --git a/plugins/zzz/daily_note.py b/plugins/zzz/daily_note.py index b3abd75..8aeca94 100644 --- a/plugins/zzz/daily_note.py +++ b/plugins/zzz/daily_note.py @@ -55,11 +55,13 @@ class DailyNotePlugin(Plugin): "current_train_score": daily_info.current_train_score, "max_train_score": daily_info.max_train_score, "card_sign_status": daily_info.card_sign == ZZZNoteCardSignState.DONE, + "bounty_commission": daily_info.bounty_commission, + "survey_points": daily_info.survey_points, } render_result = await self.template_service.render( "zzz/daily_note/daily_note.jinja2", render_data, - {"width": 600, "height": 390}, + {"width": 600, "height": 480}, full_page=False, ttl=8 * 60, ) diff --git a/plugins/zzz/stats.py b/plugins/zzz/stats.py index e0a64b7..94b7a25 100644 --- a/plugins/zzz/stats.py +++ b/plugins/zzz/stats.py @@ -75,10 +75,12 @@ class PlayerStatsPlugins(Plugin): "stats_labels": [ ("活跃天数", "active_days"), ("获取角色数", "avatar_num"), - ("绳网声望", "world_level_name"), + ("达成成就数", "achievement_count"), ("式舆防卫战防线", "cur_period_zone_layer_count"), ("获得邦布数", "buddy_num"), + ("绳网声望", "world_level_name"), ], + "cat_notes_list": user_info.cat_notes_list, "style": "main", # nosec } await self.add_theme_data(data, uid) diff --git a/resources/zzz/daily_note/daily_note.jinja2 b/resources/zzz/daily_note/daily_note.jinja2 index 67fc28b..8ca8593 100644 --- a/resources/zzz/daily_note/daily_note.jinja2 +++ b/resources/zzz/daily_note/daily_note.jinja2 @@ -36,7 +36,7 @@