mirror of
https://github.com/PaiGramTeam/PaiGram.git
synced 2024-11-22 07:07:46 +00:00
🐛 修复 abyss
的 bug
修复未绑定 cookie 时, 使用`/abyss`查询具体层数的数据时出现的错误 Signed-off-by: Karako <karakohear@gmail.com>
This commit is contained in:
parent
59be6fc7a4
commit
94b14773a7
@ -207,10 +207,14 @@ class Abyss(Plugin, BasePlugin):
|
||||
return value
|
||||
|
||||
abyss_data = await client.get_spiral_abyss(uid, previous=previous, lang="zh-cn")
|
||||
|
||||
if not abyss_data.unlocked:
|
||||
raise AbyssUnlocked()
|
||||
if not abyss_data.ranks.most_kills:
|
||||
raise NoMostKills()
|
||||
if (total or (floor > 0)) and not abyss_data.floors[0].chambers[0].battles:
|
||||
raise CookiesNotFoundError
|
||||
|
||||
end_time = abyss_data.end_time.astimezone(TZ)
|
||||
time = end_time.strftime("%Y年%m月") + "上" if end_time.day <= 16 else "下" + "期"
|
||||
stars = [i.stars for i in filter(lambda x: x.floor > 8, abyss_data.floors)]
|
||||
@ -218,9 +222,7 @@ class Abyss(Plugin, BasePlugin):
|
||||
|
||||
render_data = {}
|
||||
result = await async_re_sub(
|
||||
regex_01,
|
||||
partial(replace_01, assets_service=self.assets_service),
|
||||
abyss_data.json(encoder=json_encoder),
|
||||
regex_01, partial(replace_01, assets_service=self.assets_service), abyss_data.json(encoder=json_encoder)
|
||||
)
|
||||
result = await async_re_sub(regex_02, partial(replace_02, assets_service=self.assets_service), result)
|
||||
|
||||
|
@ -51,8 +51,8 @@
|
||||
<div class="chamber">
|
||||
<div class="chamber-info">
|
||||
<div>
|
||||
第 {{ loop.index }} 间 <span
|
||||
style="color: #A3A3A3">{{ chamber.battles[0].timestamp }}</span>
|
||||
第 {{ chamber.chamber }} 间
|
||||
<span style="color: #A3A3A3">{{ chamber.battles[0].timestamp }}</span>
|
||||
</div>
|
||||
<div class="stars">
|
||||
{% for n in range(chamber.stars) %}
|
||||
@ -83,7 +83,7 @@
|
||||
</div>
|
||||
{% endfor %}
|
||||
{% if loop.length > 1 %}
|
||||
<div class="battle-info">{{ ['上', '下'][loop.index0] }}半</div>
|
||||
<div class="battle-info">{{ ['上', '下'][battle.half - 1] }}半</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
|
Loading…
Reference in New Issue
Block a user