Archived
1
0
Fork 0

fix unable to get basic chart problem

0 == False
This commit is contained in:
ZoruaFox 2024-01-13 03:07:42 +08:00
parent 52815a6bd7
commit 3f79384383
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]