From f23eccc050d248aba18142a56e9791e54e629047 Mon Sep 17 00:00:00 2001 From: Labrys of Knossos Date: Sat, 19 Jan 2019 14:24:06 -0500 Subject: [PATCH] Refactor torrent resuming configuration --- core/__init__.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/core/__init__.py b/core/__init__.py index b95c0183..e53999ec 100644 --- a/core/__init__.py +++ b/core/__init__.py @@ -491,6 +491,14 @@ def configure_torrent_categories(): CATEGORIES = CATEGORIES.split(',') +def configure_torrent_resuming(): + global TORRENT_RESUME + global TORRENT_RESUME_ON_FAILURE + + TORRENT_RESUME_ON_FAILURE = int(CFG['Torrent']['resumeOnFailure']) + TORRENT_RESUME = int(CFG['Torrent']['resume']) + + def configure_torrents(): global TORRENT_CLIENT_AGENT global USE_LINK @@ -498,8 +506,6 @@ def configure_torrents(): global TORRENT_DEFAULT_DIRECTORY global DELETE_ORIGINAL global TORRENT_CHMOD_DIRECTORY - global TORRENT_RESUME_ON_FAILURE - global TORRENT_RESUME TORRENT_CLIENT_AGENT = CFG['Torrent']['clientAgent'] # utorrent | deluge | transmission | rtorrent | vuze | qbittorrent |other USE_LINK = CFG['Torrent']['useLink'] # no | hard | sym @@ -509,9 +515,7 @@ def configure_torrents(): configure_torrent_categories() DELETE_ORIGINAL = int(CFG['Torrent']['deleteOriginal']) TORRENT_CHMOD_DIRECTORY = int(str(CFG['Torrent']['chmodDirectory']), 8) - TORRENT_RESUME_ON_FAILURE = int(CFG['Torrent']['resumeOnFailure']) - TORRENT_RESUME = int(CFG['Torrent']['resume']) - + configure_torrent_resuming() configure_utorrent() configure_transmission() configure_deluge()