Fix incorrect reporting of number of torrents by search
This commit is contained in:
parent
66eabdda18
commit
71b970e68a
4
bot.py
4
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]) + ", "
|
||||
|
|
Loading…
Reference in New Issue