fix(recipe): ensure custom recipes_path is added to preview allowed roots on startup

This commit is contained in:
Will Miao
2026-07-14 18:15:20 +08:00
parent 419bbc90b2
commit 02c249917a

View File

@@ -208,6 +208,12 @@ class Config:
if not isinstance(library_config, dict): if not isinstance(library_config, dict):
return return
# Always read recipes_path — it is independent of extra folder paths
# and must be set before any early returns below.
recipes_path = library_config.get("recipes_path", "")
if isinstance(recipes_path, str) and recipes_path:
self.recipes_path = recipes_path
extra_folder_paths = library_config.get("extra_folder_paths") extra_folder_paths = library_config.get("extra_folder_paths")
if not isinstance(extra_folder_paths, dict): if not isinstance(extra_folder_paths, dict):
return return
@@ -233,10 +239,6 @@ class Config:
extra_embedding extra_embedding
) )
recipes_path = library_config.get("recipes_path", "")
if isinstance(recipes_path, str) and recipes_path:
self.recipes_path = recipes_path
if self.extra_loras_roots: if self.extra_loras_roots:
logger.info( logger.info(
"Found extra LoRA roots:" "Found extra LoRA roots:"