@@ -75,6 +75,25 @@ def normalize_and_create_path(path):
7575 return normalized_path
7676
7777
78+ def normalize_category_paths (data ):
79+ """Normalize and validate absolute paths in CATEGORY_PATHS."""
80+ if not isinstance (data , dict ):
81+ return data
82+ valid_names = set (CATEGORY_MAP .values ())
83+ for key , value in list (data .items ()):
84+ if key not in valid_names :
85+ raise ValidationError (
86+ f"Unknown category '{ key } ' in CATEGORY_PATHS. "
87+ f"Valid categories: { ', ' .join (sorted (valid_names ))} "
88+ )
89+ if isinstance (value , str ) and value :
90+ normalized = os .path .normpath (value )
91+ if os .path .isabs (normalized ):
92+ validate_no_eqgame (normalized )
93+ data [key ] = normalized
94+ return data
95+
96+
7897# Custom Dynaconf validator specifically for SPECIAL_RESOURCE paths
7998def normalize_paths_in_dict (data , parent_key = None ):
8099 if isinstance (data , dict ):
@@ -153,7 +172,8 @@ def initialize_config():
153172 Validator ("DOWNLOAD_FOLDER" , cast = normalize_and_create_path ),
154173 # Separate validator for EQPATH to avoid triggering eqgame.exe check
155174 Validator ("EQPATH" , default = None , cast = lambda x : os .path .normpath (x ) if x else None ),
156- Validator ("SPECIAL_RESOURCES" , cast = normalize_paths_in_dict )
175+ Validator ("SPECIAL_RESOURCES" , cast = normalize_paths_in_dict ),
176+ Validator ("CATEGORY_PATHS" , default = {}, cast = normalize_category_paths )
157177 ]
158178 )
159179
0 commit comments