mirror of
https://github.com/clinton-hall/nzbToMedia.git
synced 2025-08-20 21:33:13 -07:00
only try extracting if extract is enabled. Fixes #523
This commit is contained in:
parent
e61ffe3bb6
commit
1c21cc72f5
3 changed files with 15 additions and 4 deletions
|
@ -118,6 +118,10 @@ class autoProcessMovie:
|
|||
remote_path = int(nzbtomedia.CFG[section][inputCategory]["remote_path"])
|
||||
except:
|
||||
remote_path = 0
|
||||
try:
|
||||
extract = int(section[inputCategory]["extract"])
|
||||
except:
|
||||
extract = 0
|
||||
|
||||
if ssl:
|
||||
protocol = "https://"
|
||||
|
@ -160,7 +164,7 @@ class autoProcessMovie:
|
|||
process_all_exceptions(inputName.lower(), 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))
|
||||
nzbtomedia.extractFiles(dirName)
|
||||
inputName, dirName = convert_to_ascii(inputName, dirName)
|
||||
|
|
|
@ -47,11 +47,14 @@ class autoProcessMusic:
|
|||
web_root = nzbtomedia.CFG[section][inputCategory]["web_root"]
|
||||
except:
|
||||
web_root = ""
|
||||
|
||||
try:
|
||||
remote_path = int(nzbtomedia.CFG[section][inputCategory]["remote_path"])
|
||||
except:
|
||||
remote_path = 0
|
||||
try:
|
||||
extract = int(section[inputCategory]["extract"])
|
||||
except:
|
||||
extract = 0
|
||||
|
||||
if ssl:
|
||||
protocol = "https://"
|
||||
|
@ -77,7 +80,7 @@ class autoProcessMusic:
|
|||
process_all_exceptions(inputName.lower(), 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))
|
||||
nzbtomedia.extractFiles(dirName)
|
||||
inputName, dirName = convert_to_ascii(inputName, dirName)
|
||||
|
|
|
@ -87,6 +87,10 @@ class autoProcessTV:
|
|||
force = int(nzbtomedia.CFG[section][inputCategory]["force"])
|
||||
except:
|
||||
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.
|
||||
dirName = os.path.split(os.path.normpath(dirName))[0]
|
||||
|
@ -138,7 +142,7 @@ class autoProcessTV:
|
|||
# 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.
|
||||
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))
|
||||
nzbtomedia.extractFiles(dirName)
|
||||
inputName, dirName = convert_to_ascii(inputName, dirName)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue