Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bypass for manual execution #1788

Merged
merged 8 commits into from
Oct 16, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions TorrentToMedia.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 ...')
Expand Down
4 changes: 4 additions & 0 deletions autoProcessMedia.cfg.spec
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
12 changes: 7 additions & 5 deletions core/auto_process/movies.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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),
Expand Down
1 change: 1 addition & 0 deletions core/plugins/downloaders/nzb/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -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_manual'], 0)

configure_sabnzbd(nzb_config)

Expand Down
1 change: 1 addition & 0 deletions core/plugins/downloaders/torrent/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -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_manual'], 0)

configure_torrent_linking(torrent_config)
configure_flattening(torrent_config)
Expand Down
2 changes: 2 additions & 0 deletions nzbToMedia.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 ...')
Expand Down