This commit is contained in:
2026-01-19 06:24:09 -08:00
parent a961ac3ce7
commit 7ddf0065d1
45 changed files with 627 additions and 411 deletions

View File

@@ -21,7 +21,7 @@ from dataclasses import dataclass, field
from fnmatch import fnmatch
from urllib.parse import urlparse
import SYS.utils_constant
from SYS.utils_constant import mime_maps
try:
import cbor2
@@ -140,7 +140,7 @@ def create_metadata_sidecar(file_path: Path, metadata: dict) -> None:
metadata["hash"] = sha256_file(file_path)
metadata["size"] = Path(file_path).stat().st_size
format_found = False
for mime_type, ext_map in SYS.utils_constant.mime_maps.items():
for mime_type, ext_map in mime_maps.items():
for key, info in ext_map.items():
if info.get("ext") == file_ext:
metadata["type"] = mime_type
@@ -516,7 +516,7 @@ def get_api_key(config: dict[str, Any], service: str, key_path: str) -> str | No
"""
try:
parts = key_path.split(".")
value = config
value: Any = config
for part in parts:
if isinstance(value, dict):
value = value.get(part)