check for pausedUP state

This commit is contained in:
Jeffrey Serio 2024-07-27 21:01:18 -05:00
parent 0f07829f4d
commit 4a72d27766

View File

@ -48,19 +48,16 @@ if __name__ == "__main__":
qb = Client(args["HOSTNAME"]) qb = Client(args["HOSTNAME"])
qb.login(username=args["USERNAME"], password=args["PASSWORD"]) qb.login(username=args["USERNAME"], password=args["PASSWORD"])
# get torrents
torrents = qb.torrents()
# get total_completed_bytes # get total_completed_bytes
completed_torrent_sizes = list() completed_torrent_sizes = []
for torrent in torrents: for torrent in qb.torrents():
if torrent.get("state") == "queuedUP": # type: ignore if torrent["state"] == "queuedUP" or torrent["state"] == "pausedUP": # type: ignore
completed_torrent_sizes.append(torrent.get("total_size")) # type: ignore completed_torrent_sizes.append(torrent["total_size"]) # type: ignore
total_completed_bytes = sum(completed_torrent_sizes) total_completed_bytes = sum(completed_torrent_sizes)
# get total_added_bytes # get total_added_bytes
total_added_bytes = sum([torrent.get("total_size") for torrent in torrents]) # type: ignore total_added_bytes = sum([torrent["total_size"] for torrent in torrents]) # type: ignore
# print the results # print the results
print(f"\nTotal completed size: {human_bytes(total_completed_bytes)}") print(f"\nTotal completed size: {human_bytes(total_completed_bytes)}")