fix(preflight): 报告只在整库扫描且有非 READY 时落盘

This commit is contained in:
ali
2026-11-19 00:49:45 +08:00
parent 3e1ac3c77d
commit e60227ffd1
2 changed files with 8 additions and 2 deletions
+5 -1
View File
@@ -305,10 +305,14 @@ class PreflightService:
# ------------------------------------------------------------------ 报告
@classmethod
def write_report(cls, root: Path, results: list) -> Path | None:
def write_report(cls, root: Path, results: list, only_issues: bool = False) -> Path | None:
"""results: [(path, PreflightResult)],输出 root/preflight_report.csv"""
if not config.PREFLIGHT_REPORT or not results:
return None
if only_issues:
results = [(p, r) for p, r in results if r.verdict != READY]
if not results:
return None
report = root / "preflight_report.csv"
header = "path,verdict,codec,height,mbps,dv_profile,audio_codecs,sub_codecs,actions,reasons\n"
lines = [header]