feat: hide flagged scientific review captions

This commit is contained in:
2026-08-25 17:16:55 +08:00
parent fb5a4017f6
commit 257d7e1759
5 changed files with 44 additions and 6 deletions
@@ -392,6 +392,9 @@ def finalize(
if [item["id"] for item in all_reviews] != [item["id"] for item in items]:
raise ReviewError("scientific reviews do not cover every subtitle segment exactly once")
reviewed = {record["id"]: record["translation"] for record in all_reviews}
suppressed_segment_ids = [
record["id"] for record in all_reviews if record["status"] == "flagged"
]
reviewed_dir = review_dir / REVIEWED_DIR_NAME
reviewed_dir.mkdir(parents=True, exist_ok=True)
reviewed_path = reviewed_dir / "translations.json"
@@ -423,6 +426,7 @@ def finalize(
"initial_translation_sha256": _sha256_json(initial),
"reviewed_translation_sha256": _sha256_json(reviewed),
"reviewed_translations_dir": str(reviewed_dir.resolve()),
"suppressed_segment_ids": suppressed_segment_ids,
"profile": profile,
"counts": {
"total": len(all_reviews),