Merge pull request #17 from outis1one/clDemoe/seasonal-sunrise-montage-nn268

Fix music file matching: Mvt3 was resolving to Mvt1 for every season
This commit is contained in:
Outis
2026-04-20 10:35:57 -04:00
committed by GitHub
2 changed files with 4 additions and 2 deletions
+2 -1
View File
@@ -36,7 +36,8 @@ eval "$_season_info"
echo "Season=$SEASON Mvt=$MVT_NUM Year=$ASTRO_YEAR Day=$DAY_OF_MVT/$DAYS_IN_MVT LastDay=$IS_LAST_DAY" echo "Season=$SEASON Mvt=$MVT_NUM Year=$ASTRO_YEAR Day=$DAY_OF_MVT/$DAYS_IN_MVT LastDay=$IS_LAST_DAY"
# ── Locate music file and get its duration ──────────────────────────────────── # ── Locate music file and get its duration ────────────────────────────────────
music_file=$(find "$music_base_dir" -type f -iname "*${SEASON}*Mvt*${MVT_NUM}*" | sort | head -n 1) music_file=$(find "$music_base_dir" -type f -iname "*${SEASON}*" \
| grep -iE "Mvt[^0-9]*${MVT_NUM}[^0-9]" | sort | head -n 1)
if [ -z "$music_file" ] || [ ! -f "$music_file" ]; then if [ -z "$music_file" ] || [ ! -f "$music_file" ]; then
echo "ERROR: Music file not found for $SEASON Mvt $MVT_NUM in $music_base_dir" echo "ERROR: Music file not found for $SEASON Mvt $MVT_NUM in $music_base_dir"
exit 1 exit 1
+2 -1
View File
@@ -53,7 +53,8 @@ video_dir="$MOVIES_DIR/$CAM_NAME/$ASTRO_YEAR/$SEASON/Mvt$MVT_NUM"
output_dir="$video_dir/montage" output_dir="$video_dir/montage"
mkdir -p "$output_dir" mkdir -p "$output_dir"
music_file=$(find "$music_base_dir" -type f -iname "*${SEASON}*Mvt*${MVT_NUM}*" | sort | head -n 1) music_file=$(find "$music_base_dir" -type f -iname "*${SEASON}*" \
| grep -iE "Mvt[^0-9]*${MVT_NUM}[^0-9]" | sort | head -n 1)
if [ -z "$music_file" ]; then if [ -z "$music_file" ]; then
"$SCRIPT_DIR/notify.sh" "FAILED: montage $SEASON Mvt$MVT_NUM ($ASTRO_YEAR)" \ "$SCRIPT_DIR/notify.sh" "FAILED: montage $SEASON Mvt$MVT_NUM ($ASTRO_YEAR)" \
"Music file not found in $music_base_dir" || true "Music file not found in $music_base_dir" || true