add follow links to all walk function

pull/63/head
butaixianran 2023-03-11 20:16:47 +08:00
parent 21452fd823
commit 5abd534954
2 changed files with 4 additions and 4 deletions

View File

@ -235,7 +235,7 @@ def get_model_names_by_type_and_filter(model_type:str, filter:dict) -> list:
# get information from filter
# only get those model names don't have a civitai model info file
model_names = []
for root, dirs, files in os.walk(model_folder):
for root, dirs, files in os.walk(model_folder, followlinks=True):
for filename in files:
item = os.path.join(root, filename)
# check extension
@ -555,7 +555,7 @@ def check_models_new_version_by_model_types(model_types:list, delay:float=1) ->
continue
util.printD("Scanning path: " + model_folder)
for root, dirs, files in os.walk(model_folder):
for root, dirs, files in os.walk(model_folder, followlinks=True):
for filename in files:
# check ext
item = os.path.join(root, filename)

View File

@ -77,7 +77,7 @@ def get_model_names_by_type(model_type:str) -> list:
# get information from filter
# only get those model names don't have a civitai model info file
model_names = []
for root, dirs, files in os.walk(model_folder):
for root, dirs, files in os.walk(model_folder, followlinks=True):
for filename in files:
item = os.path.join(root, filename)
# check extension
@ -106,7 +106,7 @@ def get_model_path_by_type_and_name(model_type:str, model_name:str) -> str:
# model could be in subfolder, need to walk.
model_root = ""
model_path = ""
for root, dirs, files in os.walk(folder):
for root, dirs, files in os.walk(folder, followlinks=True):
for filename in files:
if filename == model_name:
# find model