From 5772ef6d36c9814d914a5b3581de00bb7a5d5a35 Mon Sep 17 00:00:00 2001 From: zer0t3ch Date: Fri, 14 May 2021 13:03:03 -0500 Subject: [PATCH] Possibly patched errors on too-few results Commit has not been battle-tested --- music.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) mode change 100755 => 100644 music.py diff --git a/music.py b/music.py old mode 100755 new mode 100644 index cc44a4c..0133fcd --- a/music.py +++ b/music.py @@ -54,7 +54,7 @@ def inlinequery(update, context: CallbackContext): if query: sp_info = sp.search(q=query, limit=num_results) - for i in range(num_results): + for i in range(len(sp_info)): sp_title = util.get(sp_info, f"/tracks/items/[{i}]/name") sp_artist = util.get(sp_info, f"/tracks/items/[{i}]/artists/[0]/name") sp_albname = util.get(sp_info, f"/tracks/items/[{i}]/album/name") -- 2.45.2