mirror of
https://codeberg.org/hyperreal/admin-scripts
synced 2024-11-01 16:03:06 +01:00
check for pausedUP state
This commit is contained in:
parent
0f07829f4d
commit
4a72d27766
@ -48,19 +48,16 @@ if __name__ == "__main__":
|
||||
qb = Client(args["HOSTNAME"])
|
||||
qb.login(username=args["USERNAME"], password=args["PASSWORD"])
|
||||
|
||||
# get torrents
|
||||
torrents = qb.torrents()
|
||||
|
||||
# get total_completed_bytes
|
||||
completed_torrent_sizes = list()
|
||||
for torrent in torrents:
|
||||
if torrent.get("state") == "queuedUP": # type: ignore
|
||||
completed_torrent_sizes.append(torrent.get("total_size")) # type: ignore
|
||||
completed_torrent_sizes = []
|
||||
for torrent in qb.torrents():
|
||||
if torrent["state"] == "queuedUP" or torrent["state"] == "pausedUP": # type: ignore
|
||||
completed_torrent_sizes.append(torrent["total_size"]) # type: ignore
|
||||
|
||||
total_completed_bytes = sum(completed_torrent_sizes)
|
||||
|
||||
# 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(f"\nTotal completed size: {human_bytes(total_completed_bytes)}")
|
||||
|
Loading…
Reference in New Issue
Block a user