Archived
1
0
Fork 0

fix unable to get basic chart problem

0 == False
This commit is contained in:
多羅狼 2024-01-13 02:55:41 +08:00 committed by GitHub
parent e8e669c5d6
commit 164a5cc18c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View file

@ -140,8 +140,8 @@ async def _(msg: Bot.MessageSession, song: str, diff: str = None):
await msg.finish(msg.locale.t("maimai.message.music_not_found"))
if diff:
diff_index = get_diff(diff)
if not diff_index or (len(music['ds']) == 4 and diff_index == 4):
diff_index = get_diff(diff) # diff_index 的结果可能为 0
if (not diff_index and diff_index != 0) or (len(music['ds']) == 4 and diff_index == 4):
await msg.finish(msg.locale.t("maimai.message.chart_not_found"))
chart = music['charts'][diff_index]
ds = music['ds'][diff_index]

View file

@ -218,8 +218,8 @@ async def _(msg: Bot.MessageSession, id_or_alias: str, diff: str = None):
await msg.finish(msg.locale.t("maimai.message.music_not_found"))
if diff:
diff_index = get_diff(diff)
if not diff_index or (len(music['ds']) == 4 and diff_index == 4):
diff_index = get_diff(diff) # diff_index 的输出结果可能为 0
if (not diff_index and diff_index = 0) or (len(music['ds']) == 4 and diff_index == 4):
await msg.finish(msg.locale.t("maimai.message.chart_not_found"))
chart = music['charts'][diff_index]
ds = music['ds'][diff_index]