precompile and search
This commit is contained in:
@@ -49,6 +49,7 @@ def movie_lists(root, escape_folder):
|
||||
if os.path.basename(root) in escape_folder:
|
||||
return []
|
||||
total = []
|
||||
trailerRE = re.compile(r'-trailer\.', re.IGNORECASE)
|
||||
file_type = conf.media_type().upper().split(",")
|
||||
dirs = os.listdir(root)
|
||||
for entry in dirs:
|
||||
@@ -57,7 +58,7 @@ def movie_lists(root, escape_folder):
|
||||
total += movie_lists(f, escape_folder)
|
||||
elif os.path.splitext(f)[1].upper() in file_type:
|
||||
absf = os.path.abspath(f)
|
||||
if not re.match(r'.*-trailer\..*', f, re.IGNORECASE) and (conf.main_mode() == 3 or not is_link(absf)):
|
||||
if (conf.main_mode() == 3 or not is_link(absf)) and not trailerRE.search(f):
|
||||
total.append(absf)
|
||||
return total
|
||||
|
||||
|
||||
Reference in New Issue
Block a user