From 71b970e68a8cb3484d9406be9d37f3ec82757edc Mon Sep 17 00:00:00 2001 From: j4nk Date: Wed, 28 Aug 2024 21:40:03 -0400 Subject: [PATCH] Fix incorrect reporting of number of torrents by search --- bot.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bot.py b/bot.py index 3cd9518..5c5ccb3 100644 --- a/bot.py +++ b/bot.py @@ -350,10 +350,12 @@ class QBBot(slixmpp.ClientXMPP): self.api_caller.search_delete(search_id) parsed_res = json.loads(res.text) message += "```\n" - message += "Total results for \"" + search_string + "\": " + str(parsed_res["total"]) + "\n" the_list = [[r["fileName"], r["fileUrl"], str(r["nbSeeders"]), r["fileSize"]] for r in parsed_res["results"]] # Remove torrents with no seeds from the search results the_list = [i for i in the_list if int(i[2]) != 0] + + # Report the number of torrents in the search results + message += "Total results for \"" + search_string + "\": " + str(len(the_list)) + "\n" message += "\n".join([str(i) + ". " + l[0] + ", " "seeds: " + str(l[2]) + ", "