Fixing tasks.md
This commit is contained in:
+17
-6
@@ -1868,7 +1868,10 @@ def _collect_missing_video_markers(
|
|||||||
matched = next((p for p in _TASKS_VIDEO_PREFIXES if marker.startswith(p)), None)
|
matched = next((p for p in _TASKS_VIDEO_PREFIXES if marker.startswith(p)), None)
|
||||||
if matched is None:
|
if matched is None:
|
||||||
continue
|
continue
|
||||||
video_id = marker[_TASKS_VIDEO_PREFIXES[matched] :]
|
# Lowercase to match videos.json keys (import stores handles lowercased);
|
||||||
|
# otherwise a mixed-case marker like [vst:XystonGlider] falsely reports the
|
||||||
|
# handle "missing" even though "xystonglider" is defined.
|
||||||
|
video_id = marker[_TASKS_VIDEO_PREFIXES[matched] :].lower()
|
||||||
if video_id not in videos and video_id not in seen:
|
if video_id not in videos and video_id not in seen:
|
||||||
seen.add(video_id)
|
seen.add(video_id)
|
||||||
missing.append((marker, video_id))
|
missing.append((marker, video_id))
|
||||||
@@ -1914,11 +1917,19 @@ def _write_tasks_file(
|
|||||||
lines += ["_No outstanding tasks._", ""]
|
lines += ["_No outstanding tasks._", ""]
|
||||||
|
|
||||||
tasks_path.write_text("\n".join(lines), encoding="utf-8")
|
tasks_path.write_text("\n".join(lines), encoding="utf-8")
|
||||||
print(
|
|
||||||
f" Tasks written → tasks.md"
|
# Also surface the tasks in the terminal — otherwise the only signal is a file
|
||||||
+ (f" ({len(missing_videos)} missing videos)" if missing_videos else "")
|
# you have to open. Empty is stated plainly (not a misleading "Tasks written").
|
||||||
+ (f" ({len(alignment_issues)} alignment issues)" if alignment_issues else "")
|
if not missing_videos and not alignment_issues:
|
||||||
)
|
print(" No outstanding tasks.")
|
||||||
|
return
|
||||||
|
|
||||||
|
total = len(missing_videos) + len(alignment_issues)
|
||||||
|
print(f" {total} task(s) → tasks.md:")
|
||||||
|
for marker, video_id in missing_videos:
|
||||||
|
print(f" - missing video '{video_id}' (referenced as [{marker}])")
|
||||||
|
for marker_id, context in alignment_issues:
|
||||||
|
print(f' - unaligned slide {marker_id} ("{context[:50]}")')
|
||||||
|
|
||||||
|
|
||||||
# =============================================================================
|
# =============================================================================
|
||||||
|
|||||||
Reference in New Issue
Block a user