From d95cb407cb36ba93dfc737ae78042343f58b284f Mon Sep 17 00:00:00 2001 From: Clinton Hall Date: Fri, 16 Oct 2020 22:20:37 +1300 Subject: [PATCH 1/8] no_status_check prevents additional checks. #1192 --- core/auto_process/movies.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/core/auto_process/movies.py b/core/auto_process/movies.py index 4fe2d258e..52ddafbfb 100644 --- a/core/auto_process/movies.py +++ b/core/auto_process/movies.py @@ -387,6 +387,12 @@ def process(section, dir_name, input_name=None, status=0, client_agent='manual', if not release: download_id = None # we don't want to filter new releases based on this. + if no_status_check: + return ProcessResult( + status_code=0, + message='{0}: Successfully processed but no change in status confirmed'.format(section), + ) + # we will now check to see if CPS has finished renaming before returning to TorrentToMedia and unpausing. timeout = time.time() + 60 * wait_for while time.time() < timeout: # only wait 2 (default) minutes, then return. @@ -466,11 +472,7 @@ def process(section, dir_name, input_name=None, status=0, client_agent='manual', '{0} does not appear to have changed status after {1} minutes, Please check your logs.'.format(input_name, wait_for), section, ) - if no_status_check: - return ProcessResult( - status_code=0, - message='{0}: Successfully processed but no change in status confirmed'.format(section), - ) + return ProcessResult( status_code=1, message='{0}: Failed to post-process - No change in status'.format(section), From 4970e88b75a066a79f6ed6285dd24a530bbcaf02 Mon Sep 17 00:00:00 2001 From: Clinton Hall Date: Fri, 16 Oct 2020 22:24:26 +1300 Subject: [PATCH 2/8] Add option to suppress manual runs. #1778 --- autoProcessMedia.cfg.spec | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/autoProcessMedia.cfg.spec b/autoProcessMedia.cfg.spec index 4184e410d..bfc65883c 100644 --- a/autoProcessMedia.cfg.spec +++ b/autoProcessMedia.cfg.spec @@ -355,6 +355,8 @@ sabnzbd_apikey = ###### Enter the default path to your default download directory (non-category downloads). this directory is protected by safe_mode. default_downloadDirectory = + # enable this option to prevent nzbToMedia from running in manual mode and scanning an entire directory. + no_manual = 0 [Torrent] ###### clientAgent - Supported clients: utorrent, transmission, deluge, rtorrent, vuze, qbittorrent, synods, other @@ -398,6 +400,8 @@ chmodDirectory = 0 resume = 1 resumeOnFailure = 1 + # enable this option to prevent TorrentToMedia from running in manual mode and scanning an entire directory. + no_manual = 0 [Extensions] compressedExtensions = .zip,.rar,.7z,.gz,.bz,.tar,.arj,.1,.01,.001 From 7d59d01f25e95243dd12d60130851a384f0716a9 Mon Sep 17 00:00:00 2001 From: Clinton Hall Date: Fri, 16 Oct 2020 22:30:42 +1300 Subject: [PATCH 3/8] Update configuration.py --- core/plugins/downloaders/nzb/configuration.py | 1 + 1 file changed, 1 insertion(+) diff --git a/core/plugins/downloaders/nzb/configuration.py b/core/plugins/downloaders/nzb/configuration.py index 6acd4fc4c..c9a999b98 100644 --- a/core/plugins/downloaders/nzb/configuration.py +++ b/core/plugins/downloaders/nzb/configuration.py @@ -12,6 +12,7 @@ def configure_nzbs(config): nzb_config = config['Nzb'] core.NZB_CLIENT_AGENT = nzb_config['clientAgent'] # sabnzbd core.NZB_DEFAULT_DIRECTORY = nzb_config['default_downloadDirectory'] + core.NZB_NO_MANUAL = int(nzb_config['no_manuall']) configure_sabnzbd(nzb_config) From f016fd499057791a021ac4053691629e3b3cc79e Mon Sep 17 00:00:00 2001 From: Clinton Hall Date: Fri, 16 Oct 2020 22:32:03 +1300 Subject: [PATCH 4/8] Update configuration.py --- core/plugins/downloaders/torrent/configuration.py | 1 + 1 file changed, 1 insertion(+) diff --git a/core/plugins/downloaders/torrent/configuration.py b/core/plugins/downloaders/torrent/configuration.py index 8acd4b617..3104518bd 100644 --- a/core/plugins/downloaders/torrent/configuration.py +++ b/core/plugins/downloaders/torrent/configuration.py @@ -14,6 +14,7 @@ def configure_torrents(config): core.TORRENT_CLIENT_AGENT = torrent_config['clientAgent'] # utorrent | deluge | transmission | rtorrent | vuze | qbittorrent | synods | other core.OUTPUT_DIRECTORY = torrent_config['outputDirectory'] # /abs/path/to/complete/ core.TORRENT_DEFAULT_DIRECTORY = torrent_config['default_downloadDirectory'] + core.TORRENT_NO_MANUAL = int(torrent_config['no_manuall']) configure_torrent_linking(torrent_config) configure_flattening(torrent_config) From 8fdf913a0dfa20a91091db0c2ced76a08373397c Mon Sep 17 00:00:00 2001 From: Clinton Hall Date: Fri, 16 Oct 2020 22:38:32 +1300 Subject: [PATCH 5/8] Bypass for manual --- nzbToMedia.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/nzbToMedia.py b/nzbToMedia.py index 0cc0b7965..7cb8e1e97 100755 --- a/nzbToMedia.py +++ b/nzbToMedia.py @@ -999,6 +999,8 @@ def main(args, section=None): elif len(args) > 5 and args[5] == 'generic': logger.info('Script triggered from generic program') result = process(args[1], input_name=args[2], input_category=args[3], download_id=args[4]) + elif core.NZB_NO_MANUAL: + logger.warning('Invalid number of arguments received from client, and no_manual set') else: # Perform Manual Post-Processing logger.warning('Invalid number of arguments received from client, Switching to manual run mode ...') From 82042b3a5744e97622fabdc99571d220c092636b Mon Sep 17 00:00:00 2001 From: Clinton Hall Date: Fri, 16 Oct 2020 22:40:54 +1300 Subject: [PATCH 6/8] Bypass manual --- TorrentToMedia.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/TorrentToMedia.py b/TorrentToMedia.py index 56a9b5a75..b37ed60eb 100755 --- a/TorrentToMedia.py +++ b/TorrentToMedia.py @@ -317,6 +317,8 @@ def main(args): if input_directory and input_name and input_hash and input_id: result = process_torrent(input_directory, input_name, input_category, input_hash, input_id, client_agent) + elif core.TORRENT_NO_MANUAL: + logger.warning('Invalid number of arguments received from client, and no_manual set') else: # Perform Manual Post-Processing logger.warning('Invalid number of arguments received from client, Switching to manual run mode ...') From ed51b3954ac9faaf8ba8e2dc2e251c360471915c Mon Sep 17 00:00:00 2001 From: Clinton Hall Date: Fri, 16 Oct 2020 22:51:18 +1300 Subject: [PATCH 7/8] Update configuration.py --- core/plugins/downloaders/torrent/configuration.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/plugins/downloaders/torrent/configuration.py b/core/plugins/downloaders/torrent/configuration.py index 3104518bd..9344ba7f6 100644 --- a/core/plugins/downloaders/torrent/configuration.py +++ b/core/plugins/downloaders/torrent/configuration.py @@ -14,7 +14,7 @@ def configure_torrents(config): core.TORRENT_CLIENT_AGENT = torrent_config['clientAgent'] # utorrent | deluge | transmission | rtorrent | vuze | qbittorrent | synods | other core.OUTPUT_DIRECTORY = torrent_config['outputDirectory'] # /abs/path/to/complete/ core.TORRENT_DEFAULT_DIRECTORY = torrent_config['default_downloadDirectory'] - core.TORRENT_NO_MANUAL = int(torrent_config['no_manuall']) + core.TORRENT_NO_MANUAL = int(torrent_config['no_manual'], 0) configure_torrent_linking(torrent_config) configure_flattening(torrent_config) From 9e6d83491d6db744dc8fc531a3ac39b4243279fd Mon Sep 17 00:00:00 2001 From: Clinton Hall Date: Fri, 16 Oct 2020 22:51:51 +1300 Subject: [PATCH 8/8] Update configuration.py --- core/plugins/downloaders/nzb/configuration.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/plugins/downloaders/nzb/configuration.py b/core/plugins/downloaders/nzb/configuration.py index c9a999b98..62d57ab6f 100644 --- a/core/plugins/downloaders/nzb/configuration.py +++ b/core/plugins/downloaders/nzb/configuration.py @@ -12,7 +12,7 @@ def configure_nzbs(config): nzb_config = config['Nzb'] core.NZB_CLIENT_AGENT = nzb_config['clientAgent'] # sabnzbd core.NZB_DEFAULT_DIRECTORY = nzb_config['default_downloadDirectory'] - core.NZB_NO_MANUAL = int(nzb_config['no_manuall']) + core.NZB_NO_MANUAL = int(nzb_config['no_manual'], 0) configure_sabnzbd(nzb_config)