Add MOVIES_DIR to conf; remove hardcoded 'movies' subdir
All scripts now use $MOVIES_DIR instead of $BASE_DIR/movies. Defaults to BASE_DIR/movies but can point to a separate drive. https://claude.ai/code/session_01C4jbd3waXG3eKZYbGUjLUQ
This commit is contained in:
+1
-1
@@ -62,7 +62,7 @@ fi
|
|||||||
echo "Images found: $total_images"
|
echo "Images found: $total_images"
|
||||||
|
|
||||||
# ── Prepare output directory ──────────────────────────────────────────────────
|
# ── Prepare output directory ──────────────────────────────────────────────────
|
||||||
output_dir="$base_dir/movies/$CAM_NAME/$ASTRO_YEAR/$SEASON/Mvt$MVT_NUM"
|
output_dir="$MOVIES_DIR/$CAM_NAME/$ASTRO_YEAR/$SEASON/Mvt$MVT_NUM"
|
||||||
mkdir -p "$output_dir"
|
mkdir -p "$output_dir"
|
||||||
|
|
||||||
# ── Build sorted image list ───────────────────────────────────────────────────
|
# ── Build sorted image list ───────────────────────────────────────────────────
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ output_date=$(date +%Y-%m)
|
|||||||
image_dir="$BASE_DIR/$CAM_NAME/$current_date"
|
image_dir="$BASE_DIR/$CAM_NAME/$current_date"
|
||||||
|
|
||||||
# Set output directory
|
# Set output directory
|
||||||
output_dir="$BASE_DIR/movies/$CAM_NAME/$output_date/sunrise-only"
|
output_dir="$MOVIES_DIR/$CAM_NAME/$output_date/sunrise-only"
|
||||||
|
|
||||||
# Make sure the output directory exists
|
# Make sure the output directory exists
|
||||||
mkdir -p "$output_dir"
|
mkdir -p "$output_dir"
|
||||||
|
|||||||
+1
-1
@@ -20,7 +20,7 @@ base_dir="$BASE_DIR"
|
|||||||
# ── Date / paths ──────────────────────────────────────────────────────────────
|
# ── Date / paths ──────────────────────────────────────────────────────────────
|
||||||
yesterday=$(date --date="yesterday" +%Y-%m-%d)
|
yesterday=$(date --date="yesterday" +%Y-%m-%d)
|
||||||
image_dir="$base_dir/$CAM_NAME/$yesterday"
|
image_dir="$base_dir/$CAM_NAME/$yesterday"
|
||||||
output_dir="$base_dir/movies/$CAM_NAME/fullday"
|
output_dir="$MOVIES_DIR/$CAM_NAME/fullday"
|
||||||
mkdir -p "$output_dir"
|
mkdir -p "$output_dir"
|
||||||
|
|
||||||
# ── Purge old full-day videos ─────────────────────────────────────────────────
|
# ── Purge old full-day videos ─────────────────────────────────────────────────
|
||||||
|
|||||||
+1
-1
@@ -43,7 +43,7 @@ eval "$(python3 "$SCRIPT_DIR/season_info.py" ${DATE_ARG:+"$DATE_ARG"})"
|
|||||||
echo "Season=$SEASON Mvt=$MVT_NUM Year=$ASTRO_YEAR (ref: ${DATE_ARG:-today})"
|
echo "Season=$SEASON Mvt=$MVT_NUM Year=$ASTRO_YEAR (ref: ${DATE_ARG:-today})"
|
||||||
|
|
||||||
# ── Locate files ──────────────────────────────────────────────────────────────
|
# ── Locate files ──────────────────────────────────────────────────────────────
|
||||||
video_dir="$base_dir/movies/$CAM_NAME/$ASTRO_YEAR/$SEASON/Mvt$MVT_NUM"
|
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"
|
||||||
|
|
||||||
|
|||||||
@@ -152,6 +152,7 @@ SCRIPT_DIR=/home/motion/drives/local-2tb/sunrise-scripts
|
|||||||
|
|
||||||
# ── Storage ───────────────────────────────────────────────────────────────────
|
# ── Storage ───────────────────────────────────────────────────────────────────
|
||||||
BASE_DIR=/home/motion/drives/local-2tb
|
BASE_DIR=/home/motion/drives/local-2tb
|
||||||
|
MOVIES_DIR=$BASE_DIR/movies # override if videos live on a different drive
|
||||||
MUSIC_DIR=/home/motion/drives/local-2tb/music/4 Seasons
|
MUSIC_DIR=/home/motion/drives/local-2tb/music/4 Seasons
|
||||||
|
|
||||||
# ── Location & timezone ───────────────────────────────────────────────────────
|
# ── Location & timezone ───────────────────────────────────────────────────────
|
||||||
|
|||||||
+1
-1
@@ -45,7 +45,7 @@ today_date_str = today.strftime("%Y-%m-%d") # e.g., "2024-11-05"
|
|||||||
today_month_str = today.strftime("%Y-%m") # e.g., "2024-11"
|
today_month_str = today.strftime("%Y-%m") # e.g., "2024-11"
|
||||||
|
|
||||||
# Set the full folder path for today's video
|
# Set the full folder path for today's video
|
||||||
base_video_folder = os.path.join(config.get('BASE_DIR', ''), 'movies', config.get('CAM_NAME', 'sunrise'))
|
base_video_folder = os.path.join(config.get('MOVIES_DIR', ''), config.get('CAM_NAME', 'sunrise'))
|
||||||
output_dir = os.path.join(base_video_folder, today_month_str, "sunrise-only")
|
output_dir = os.path.join(base_video_folder, today_month_str, "sunrise-only")
|
||||||
|
|
||||||
# Check if the directory exists
|
# Check if the directory exists
|
||||||
|
|||||||
+2
-2
@@ -8,7 +8,7 @@
|
|||||||
# The 12 individual movement videos already carry their own attribution overlay
|
# The 12 individual movement videos already carry their own attribution overlay
|
||||||
# (first 6 seconds of each), so no extra card is appended here.
|
# (first 6 seconds of each), so no extra card is appended here.
|
||||||
#
|
#
|
||||||
# Output: $BASE_DIR/movies/$CAM_NAME/$ASTRO_YEAR/$CAM_NAME-$ASTRO_YEAR.mp4
|
# Output: $MOVIES_DIR/$CAM_NAME/$ASTRO_YEAR/$CAM_NAME-$ASTRO_YEAR.mp4
|
||||||
|
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
@@ -23,7 +23,7 @@ fi
|
|||||||
# Camera name: second argument overrides conf (passed through from montage-mvt.sh).
|
# Camera name: second argument overrides conf (passed through from montage-mvt.sh).
|
||||||
CAM_NAME="${2:-$CAM_NAME}"
|
CAM_NAME="${2:-$CAM_NAME}"
|
||||||
|
|
||||||
year_dir="$BASE_DIR/movies/$CAM_NAME/$ASTRO_YEAR"
|
year_dir="$MOVIES_DIR/$CAM_NAME/$ASTRO_YEAR"
|
||||||
|
|
||||||
echo "Assembling Four Seasons $ASTRO_YEAR from $year_dir ..."
|
echo "Assembling Four Seasons $ASTRO_YEAR from $year_dir ..."
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user