fix: correct _safe_parse_fps placement and format setup.ts #133

Merged
xiaoxia merged 3 commits from fix/syntax-and-prettier into develop 2026-06-30 18:40:02 +08:00
2 changed files with 1 additions and 14 deletions
-1
View File
@@ -20,7 +20,6 @@ Object.defineProperty(window, "matchMedia", {
}),
});
// 扩展 Vitest 的 expect
expect.extend(matchers);
+1 -13
View File
@@ -51,19 +51,7 @@ def extract_media_metadata(file_url: str, media_type: str) -> dict:
timeout=30,
)
if result.returncode == 0:
import json
def _safe_parse_fps(fps_str: str) -> float:
"""Safely parse fps from fraction string like 30/1."""
try:
if "/" in fps_str:
num, den = fps_str.split("/")
return float(num) / float(den) if float(den) != 0 else 0.0
return float(fps_str)
except (ValueError, ZeroDivisionError):
return 0.0
as json_lib
import json as json_lib
probe_data = json_lib.loads(result.stdout)