only try extracting if extract is enabled. Fixes #523

This commit is contained in:
clinton-hall 2014-08-06 13:56:44 +09:30
commit 1c21cc72f5
3 changed files with 15 additions and 4 deletions

View file

@ -118,6 +118,10 @@ class autoProcessMovie:
remote_path = int(nzbtomedia.CFG[section][inputCategory]["remote_path"]) remote_path = int(nzbtomedia.CFG[section][inputCategory]["remote_path"])
except: except:
remote_path = 0 remote_path = 0
try:
extract = int(section[inputCategory]["extract"])
except:
extract = 0
if ssl: if ssl:
protocol = "https://" protocol = "https://"
@ -160,7 +164,7 @@ class autoProcessMovie:
process_all_exceptions(inputName.lower(), dirName) process_all_exceptions(inputName.lower(), dirName)
inputName, dirName = convert_to_ascii(inputName, dirName) inputName, dirName = convert_to_ascii(inputName, dirName)
if not listMediaFiles(dirName, media=True, audio=False, meta=False, archives=False) and listMediaFiles(dirName, media=False, audio=False, meta=False, archives=True): if not listMediaFiles(dirName, media=True, audio=False, meta=False, archives=False) and listMediaFiles(dirName, media=False, audio=False, meta=False, archives=True) and extract:
logger.debug('Checking for archives to extract in directory: %s' % (dirName)) logger.debug('Checking for archives to extract in directory: %s' % (dirName))
nzbtomedia.extractFiles(dirName) nzbtomedia.extractFiles(dirName)
inputName, dirName = convert_to_ascii(inputName, dirName) inputName, dirName = convert_to_ascii(inputName, dirName)

View file

@ -47,11 +47,14 @@ class autoProcessMusic:
web_root = nzbtomedia.CFG[section][inputCategory]["web_root"] web_root = nzbtomedia.CFG[section][inputCategory]["web_root"]
except: except:
web_root = "" web_root = ""
try: try:
remote_path = int(nzbtomedia.CFG[section][inputCategory]["remote_path"]) remote_path = int(nzbtomedia.CFG[section][inputCategory]["remote_path"])
except: except:
remote_path = 0 remote_path = 0
try:
extract = int(section[inputCategory]["extract"])
except:
extract = 0
if ssl: if ssl:
protocol = "https://" protocol = "https://"
@ -77,7 +80,7 @@ class autoProcessMusic:
process_all_exceptions(inputName.lower(), dirName) process_all_exceptions(inputName.lower(), dirName)
inputName, dirName = convert_to_ascii(inputName, dirName) inputName, dirName = convert_to_ascii(inputName, dirName)
if not listMediaFiles(dirName, media=False, audio=True, meta=False, archives=False) and listMediaFiles(dirName, media=False, audio=False, meta=False, archives=True): if not listMediaFiles(dirName, media=False, audio=True, meta=False, archives=False) and listMediaFiles(dirName, media=False, audio=False, meta=False, archives=True) and extract:
logger.debug('Checking for archives to extract in directory: %s' % (dirName)) logger.debug('Checking for archives to extract in directory: %s' % (dirName))
nzbtomedia.extractFiles(dirName) nzbtomedia.extractFiles(dirName)
inputName, dirName = convert_to_ascii(inputName, dirName) inputName, dirName = convert_to_ascii(inputName, dirName)

View file

@ -87,6 +87,10 @@ class autoProcessTV:
force = int(nzbtomedia.CFG[section][inputCategory]["force"]) force = int(nzbtomedia.CFG[section][inputCategory]["force"])
except: except:
force = 0 force = 0
try:
extract = int(section[inputCategory]["extract"])
except:
extract = 0
if not os.path.isdir(dirName) and os.path.isfile(dirName): # If the input directory is a file, assume single file download and split dir/name. if not os.path.isdir(dirName) and os.path.isfile(dirName): # If the input directory is a file, assume single file download and split dir/name.
dirName = os.path.split(os.path.normpath(dirName))[0] dirName = os.path.split(os.path.normpath(dirName))[0]
@ -138,7 +142,7 @@ class autoProcessTV:
# Now check if tv files exist in destination. # Now check if tv files exist in destination.
if listMediaFiles(dirName, media=True, audio=False, meta=False, archives=False): # Check that a video exists. if not, assume failed. if listMediaFiles(dirName, media=True, audio=False, meta=False, archives=False): # Check that a video exists. if not, assume failed.
flatten(dirName) # to make sure SickBeard can find the video (not in sub-folder) flatten(dirName) # to make sure SickBeard can find the video (not in sub-folder)
elif listMediaFiles(dirName, media=False, audio=False, meta=False, archives=True): elif listMediaFiles(dirName, media=False, audio=False, meta=False, archives=True) and extract:
logger.debug('Checking for archives to extract in directory: %s' % (dirName)) logger.debug('Checking for archives to extract in directory: %s' % (dirName))
nzbtomedia.extractFiles(dirName) nzbtomedia.extractFiles(dirName)
inputName, dirName = convert_to_ascii(inputName, dirName) inputName, dirName = convert_to_ascii(inputName, dirName)