fix: serialize media publishing decisions

This commit is contained in:
ik
2026-09-22 07:58:38 +07:00
parent f3fb5868df
commit 0eb151f5a7
9 changed files with 365 additions and 95 deletions
+5
View File
@@ -12,6 +12,11 @@ KNOWN_MEDIA_ROLES = WATERBODY_MEDIA_ROLES | TACKLE_MEDIA_ROLES
MEDIA_ROLES_BY_ENTITY = {"waterbody": WATERBODY_MEDIA_ROLES, "tackle": TACKLE_MEDIA_ROLES}
def media_manifest_version() -> int:
manifest = json.loads((MEDIA_ROOT / "manifest.json").read_text(encoding="utf-8"))
return max(1, int(manifest.get("version", 1)))
def _public_role_allowed(entity_type: str | None, role: object) -> bool:
if role is None:
return True