From 62f1330d9c825197d87f9eff3b54618d4b153cc8 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 21 Apr 2026 10:51:29 +0000 Subject: [PATCH] Fix corrupt-file detection in make-finals.sh MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The previous check used || true which masked ffprobe's non-zero exit code. For files with a missing/partial moov atom ffprobe can print a duration estimate then exit non-zero — the || true let that through. Now use || raw_dur="" to honour the exit code, and add a second probe for an actual video stream codec so files that report a duration but have no decodable stream are also caught. https://claude.ai/code/session_01C4jbd3waXG3eKZYbGUjLUQ --- make-finals.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/make-finals.sh b/make-finals.sh index b41333e..23e6432 100755 --- a/make-finals.sh +++ b/make-finals.sh @@ -110,8 +110,10 @@ while IFS= read -r -d '' temp_file; do continue fi - raw_dur=$(ffprobe -v error -show_entries format=duration -of csv=p=0 "$temp_file" 2>/dev/null || true) - if [ -z "$raw_dur" ] || [ "$raw_dur" = "N/A" ]; then + raw_dur=$(ffprobe -v error -show_entries format=duration -of csv=p=0 "$temp_file" 2>/dev/null) || raw_dur="" + vid_codec=$(ffprobe -v error -select_streams v:0 -show_entries stream=codec_name \ + -of csv=p=0 "$temp_file" 2>/dev/null) || vid_codec="" + if [ -z "$raw_dur" ] || [ "$raw_dur" = "N/A" ] || [ -z "$vid_codec" ]; then echo "SKIP (corrupt/unreadable): $temp_file" (( skipped++ )) || true continue