2026-05-18-19-46-56 强制刷新样例视频缓存

This commit is contained in:
2026-05-18 19:52:24 +08:00
parent f89ce5f5f6
commit 72c96828d5
6 changed files with 99 additions and 2 deletions

View File

@@ -59,12 +59,14 @@ def samples() -> dict[str, Any]:
for path in sorted(SAMPLE_DIR.glob("*")):
suffix = path.suffix.lower()
if suffix in IMAGE_SUFFIXES | VIDEO_SUFFIXES:
version = str(path.stat().st_mtime_ns)
items.append(
{
"name": path.name,
"url": _public(path),
"url": f"{_public(path)}?v={version}",
"kind": "image" if suffix in IMAGE_SUFFIXES else "video",
"size": path.stat().st_size,
"version": version,
}
)
return {"samples": items}