diff --git a/4-seasons.sh b/4-seasons.sh index 9ed36f6..ac07487 100755 --- a/4-seasons.sh +++ b/4-seasons.sh @@ -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" # ── 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 echo "ERROR: Music file not found for $SEASON Mvt $MVT_NUM in $music_base_dir" exit 1 diff --git a/montage-mvt.sh b/montage-mvt.sh index 49b7d7c..9854385 100755 --- a/montage-mvt.sh +++ b/montage-mvt.sh @@ -53,7 +53,8 @@ video_dir="$MOVIES_DIR/$CAM_NAME/$ASTRO_YEAR/$SEASON/Mvt$MVT_NUM" output_dir="$video_dir/montage" 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 "$SCRIPT_DIR/notify.sh" "FAILED: montage $SEASON Mvt$MVT_NUM ($ASTRO_YEAR)" \ "Music file not found in $music_base_dir" || true