Adding fixes to the pipeline
This commit is contained in:
+31
-13
@@ -84,6 +84,10 @@ def validate_project(
|
||||
)
|
||||
continue
|
||||
|
||||
# Segment markers are structural annotations, not slide references
|
||||
if marker.startswith("segment:"):
|
||||
continue
|
||||
|
||||
if marker not in slides:
|
||||
issues.append(
|
||||
ValidationIssue(
|
||||
@@ -166,23 +170,37 @@ def validate_project(
|
||||
)
|
||||
)
|
||||
|
||||
# Check background exists (image or video)
|
||||
# Try 'background' first, fall back to deprecated 'background_video'
|
||||
bg_file = config.background or config.background_video
|
||||
if bg_file:
|
||||
# Check in project folder first, then parent (for shared_assets)
|
||||
bg_path = project_path / bg_file
|
||||
bg_path, _ = resolve_with_cache(bg_path, project_path)
|
||||
if not bg_path.exists():
|
||||
# Try parent directory (shared_assets at repo root)
|
||||
bg_path = project_path.parent / bg_file
|
||||
bg_path, _ = resolve_with_cache(bg_path, project_path.parent)
|
||||
if not bg_path.exists():
|
||||
# Check background exists — must be a handle in shared_assets/videos.json
|
||||
bg_handle = config.background
|
||||
if bg_handle:
|
||||
shared_assets_dir = project_path.parent / "shared_assets"
|
||||
videos_json_path_bg = shared_assets_dir / "videos.json"
|
||||
if not videos_json_path_bg.exists():
|
||||
issues.append(
|
||||
ValidationIssue(
|
||||
f"Background not found: {bg_file}", project_path / "project.json"
|
||||
f"shared_assets/videos.json not found (needed for background handle '{bg_handle}')",
|
||||
project_path / "project.json",
|
||||
)
|
||||
)
|
||||
else:
|
||||
import json as _json
|
||||
bg_videos = _json.loads(videos_json_path_bg.read_text())
|
||||
if bg_handle not in bg_videos:
|
||||
issues.append(
|
||||
ValidationIssue(
|
||||
f"Background handle '{bg_handle}' not found in shared_assets/videos.json",
|
||||
project_path / "project.json",
|
||||
)
|
||||
)
|
||||
else:
|
||||
bg_path = shared_assets_dir / bg_videos[bg_handle]["source_file"]
|
||||
if not bg_path.exists():
|
||||
issues.append(
|
||||
ValidationIssue(
|
||||
f"Background file not found: {bg_path} (from handle '{bg_handle}')",
|
||||
project_path / "project.json",
|
||||
)
|
||||
)
|
||||
|
||||
# Check we have at least one video source
|
||||
if not videos:
|
||||
|
||||
Reference in New Issue
Block a user