diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs new file mode 100644 index 0000000..79c9ac9 --- /dev/null +++ b/.git-blame-ignore-revs @@ -0,0 +1,27 @@ +# This file contains a list of commits with +# mass changes for exclusion by `git blame`. +# +# Passing `--ignore-revs-file .git-blame-ignore-revs` as a flag will +# tell git to "ignore changes made by the revision when assigning +# blame, as if the change never happened". +# +# For example: +# git blame --ignore-revs-file .git-blame-ignore-revs ... +# +# For extra hot sauce, ignore white space changes too: +# git blame -w --ignore-revs-file .git-blame-ignore-revs ... +# +# You can make this a default for your repo using: +# git config blame.ignoreRevsFile .git-blame-ignore-revs +# +# Also, if you use the GitLens extension for Visual Studio Code, you +# can add "-w" as a value to "gitlens.advanced.blame.customArguments". +# +# Note that `git blame` does not use any file by default, and +# the filename `.git-blame-ignore-revs` is just a convention. + +345edb9fe55fb91f9f2b2dbd93c9fedbb9f371c2 +# Author: Chuangbo Li +# Date: Mon Oct 10 19:07:28 2022 +0800 +# +# 🎨 使用 black 格式化所有代码 diff --git a/modules/apihelper/abyss_team.py b/modules/apihelper/abyss_team.py index 7b4a6c5..16f787b 100644 --- a/modules/apihelper/abyss_team.py +++ b/modules/apihelper/abyss_team.py @@ -10,10 +10,6 @@ class Member(BaseModel): attr: str name: str - @validator("name") - def name_validator(cls, v): # pylint: disable=R0201 - return "空" if v == "旅行者" else v - class TeamRate(BaseModel): rate: float diff --git a/plugins/genshin/abyss_team.py b/plugins/genshin/abyss_team.py index 7be984b..5fb8c2b 100644 --- a/plugins/genshin/abyss_team.py +++ b/plugins/genshin/abyss_team.py @@ -64,11 +64,12 @@ class AbyssTeam(Plugin, BasePlugin): for lane in ["up", "down"]: for member in getattr(i, lane).formation: + name = member.name temp = { - "icon": (await self.assets_service.avatar(roleToId(member.name)).icon()).as_uri(), - "name": member.name.replace("空", "旅行者"), + "icon": (await self.assets_service.avatar(roleToId(name.replace("旅行者", "空"))).icon()).as_uri(), + "name": name, "star": member.star, - "hava": (member.name in user_data) if user_data else True, + "hava": (name in user_data) if user_data else True, } team[lane].append(temp)