Resume paused torrents

This commit is contained in:
AJ
2022-07-06 07:30:57 -04:00
parent d8e7086d35
commit 2c720e1bc5

View File

@@ -26,23 +26,25 @@ def set_ratio_limits():
if torrent.state_enum.is_downloading: if torrent.state_enum.is_downloading:
continue continue
# ratio_limit
# -2 = use the global value # -2 = use the global value
# -1 = no limit # -1 = no limit
x = -2
if torrent.num_complete <= unlimited_seed_threshold: if torrent.name == 'Storks.2016.1080p.BRRip-YTS':
x = -1 print('')
if x == torrent.ratio_limit: if torrent.num_complete > unlimited_seed_threshold:
continue if torrent.ratio_limit != -2:
torrent.set_share_limits(ratio_limit=-2, seeding_time_limit=-2)
torrent.set_share_limits(ratio_limit=x, seeding_time_limit=-2) log(f'{torrent.name}: set ratio limit to global limit')
else:
if torrent.ratio_limit != -1 or 'paused' in torrent.state:
torrent.set_share_limits(ratio_limit=-1, seeding_time_limit=-2)
torrent.resume() torrent.resume()
log(f'{torrent.name}: removed seed limit')
log(f'{torrent.name}: set ratio limit to \'{torrent.ratio_limit}\'')
logfile = open(r"C:\Tools\qbittorrent\log.txt", "a") logfile = open(r"log.txt", "a")
def log(msg): def log(msg):
logfile.write(f'[{datetime.datetime.now()}] {msg}\n') logfile.write(f'[{datetime.datetime.now()}] {msg}\n')