fix unable to get basic chart problem
0 == False
This commit is contained in:
parent
e8e669c5d6
commit
164a5cc18c
2 changed files with 4 additions and 4 deletions
|
@ -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]
|
||||
|
|
|
@ -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]
|
||||
|
|
Reference in a new issue