add test module

This commit is contained in:
2026-08-16 15:39:52 +08:00
parent d0310620fc
commit 6e4d93cea6
46 changed files with 3880 additions and 206 deletions

View File

@@ -23,7 +23,11 @@ class BoundaryStore:
self.reload()
def reload(self) -> None:
raw = json.loads(self.index_path.read_text(encoding="utf-8"))
raw = (
json.loads(self.index_path.read_text(encoding="utf-8"))
if self.index_path.is_file()
else {"videos": {}}
)
entries = raw.get("videos", raw)
if not isinstance(entries, dict):
raise ValueError("index JSON must contain a 'videos' object")