mirror of
https://github.com/Dictionarry-Hub/profilarr.git
synced 2026-01-24 19:51:03 +01:00
feat: normalize file path brackets in load_yaml_file function
This commit is contained in:
@@ -92,6 +92,8 @@ def get_category_directory(category: str) -> str:
|
||||
|
||||
|
||||
def load_yaml_file(file_path: str) -> Dict[str, Any]:
|
||||
file_path = file_path.replace('[', '(').replace(']', ')')
|
||||
|
||||
if not os.path.exists(file_path):
|
||||
logger.error(f"File not found: {file_path}")
|
||||
raise FileNotFoundError(f"File not found: {file_path}")
|
||||
@@ -100,9 +102,11 @@ def load_yaml_file(file_path: str) -> Dict[str, Any]:
|
||||
with open(file_path, 'r') as f:
|
||||
content = yaml.safe_load(f)
|
||||
return content
|
||||
|
||||
except yaml.YAMLError as e:
|
||||
logger.error(f"Error parsing YAML file {file_path}: {e}")
|
||||
raise
|
||||
|
||||
except Exception as e:
|
||||
logger.error(f"Unexpected error reading file {file_path}: {e}")
|
||||
raise
|
||||
|
||||
Reference in New Issue
Block a user