mirror of
https://github.com/clinton-hall/nzbToMedia.git
synced 2025-07-14 17:22:53 -07:00
improve user script media extension handling
This commit is contained in:
parent
9bd61af1bf
commit
bb6eff806e
3 changed files with 12 additions and 11 deletions
|
@ -11,7 +11,7 @@ def external_script(outputDestination, torrentName, torrentLabel, settings):
|
|||
final_result = 0 # start at 0.
|
||||
num_files = 0
|
||||
try:
|
||||
core.USER_SCRIPT_MEDIAEXTENSIONS = settings["user_script_mediaExtensions"]
|
||||
core.USER_SCRIPT_MEDIAEXTENSIONS = settings["user_script_mediaExtensions"].lower()
|
||||
if isinstance(core.USER_SCRIPT_MEDIAEXTENSIONS, str):
|
||||
core.USER_SCRIPT_MEDIAEXTENSIONS = core.USER_SCRIPT_MEDIAEXTENSIONS.split(',')
|
||||
except:
|
||||
|
@ -51,7 +51,7 @@ def external_script(outputDestination, torrentName, torrentLabel, settings):
|
|||
filePath = core.os.path.join(dirpath, file)
|
||||
fileName, fileExtension = os.path.splitext(file)
|
||||
|
||||
if fileExtension in core.USER_SCRIPT_MEDIAEXTENSIONS or "ALL" in core.USER_SCRIPT_MEDIAEXTENSIONS:
|
||||
if fileExtension in core.USER_SCRIPT_MEDIAEXTENSIONS or "all" in core.USER_SCRIPT_MEDIAEXTENSIONS:
|
||||
num_files += 1
|
||||
if core.USER_SCRIPT_RUNONCE == 1 and num_files > 1: # we have already run once, so just continue to get number of files.
|
||||
continue
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue