INNER CODE UNIT · Python
builtin_style_image_path
ChenShuo2004/cs-board · webapp/server.py:373
def builtin_style_image_path(definition: dict[str, str]) -> Path | None:
relative_path = definition["image_url"].lstrip("/")
candidates = (
ROOT / "web" / "public" / relative_path,
ROOT / "web" / "dist" / "client" / relative_path,
)
return next((path for path in candidates if path.is_file()), None)
def is_infographic_job(job_id: str) -> bool:
item = JOBS.get(job_id, {})
return (
item.get("reference_mode") == "infographic"
or item.get("job_type") == "infographic"
or item.get("style") == INFOGRAPHIC_STYLE # Compatibility with the first preview build.
)