mirror of
https://github.com/clinton-hall/nzbToMedia.git
synced 2025-08-20 21:33:13 -07:00
added safe_mode to prevent processing ALL downloads.
This commit is contained in:
parent
7ece7997a9
commit
07719e79b6
4 changed files with 35 additions and 3 deletions
|
@ -24,6 +24,11 @@
|
|||
# Enable/Disable media file checking using ffprobe.
|
||||
#check_media=1
|
||||
|
||||
# Safe Mode protection of DestDir (0, 1).
|
||||
#
|
||||
# Enable/Disable a safety check to ensure we don't process all downloads in the default_downloadDirectory by mistake.
|
||||
#safe_mode=1
|
||||
|
||||
## CouchPotato
|
||||
|
||||
# CouchPotato script category.
|
||||
|
@ -309,6 +314,12 @@ from nzbtomedia import logger, nzbToMediaDB
|
|||
|
||||
# post-processing
|
||||
def process(inputDirectory, inputName=None, status=0, clientAgent='manual', download_id=None, inputCategory=None):
|
||||
if nzbtomedia.SAFE_MODE and inputDirectory == nzbtomedia.NZB_DEFAULTDIR:
|
||||
logger.error(
|
||||
'The input directory:[%s] is the Default Download Directory. Please configure category directories to prevent processing of other media.' % (
|
||||
inputDirectory))
|
||||
return -1
|
||||
|
||||
if clientAgent != 'manual' and not nzbtomedia.DOWNLOADINFO:
|
||||
logger.debug('Adding NZB download info for directory %s to database' % (inputDirectory))
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue