Degrade gracefully on overlay/audio failure; notify on upload success
Sunrise: - Overlay failure no longer exits 1; the speed-only video is renamed to the expected final path so OnSuccess still fires and the upload still happens - sunrise2mm.py now notifies on every upload outcome (success, post failure, file-not-found) via notify.sh so the user always knows whether the video reached Mattermost Montage: - Music+overlay failure no longer exits 1; the sped video is promoted to the *-Montage.mp4 path so year-end-join can still include this movement (as a silent, no-overlay clip) and the user is notified of the degraded output - Year-end join trigger is now outside the success/failure branch so it fires in both cases https://claude.ai/code/session_01C4jbd3waXG3eKZYbGUjLUQ
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
#!/usr/bin/env python3
|
||||
import requests
|
||||
import os
|
||||
import subprocess
|
||||
from datetime import datetime
|
||||
|
||||
import pathlib
|
||||
@@ -91,9 +92,33 @@ if os.path.isfile(final_video_file):
|
||||
|
||||
if message_response.status_code == 201:
|
||||
print("Message posted successfully.")
|
||||
subprocess.run(
|
||||
[str(_here / 'notify.sh'),
|
||||
f"Sunrise uploaded: {today_date_str}",
|
||||
f"Video posted to Mattermost successfully"],
|
||||
check=False
|
||||
)
|
||||
else:
|
||||
print(f"Failed to post message: {message_response.text}")
|
||||
subprocess.run(
|
||||
[str(_here / 'notify.sh'),
|
||||
f"FAILED: sunrise Mattermost post {today_date_str}",
|
||||
f"File uploaded but post failed: {message_response.status_code}"],
|
||||
check=False
|
||||
)
|
||||
else:
|
||||
print(f"Failed to upload {final_video_file}: {response.text}")
|
||||
subprocess.run(
|
||||
[str(_here / 'notify.sh'),
|
||||
f"FAILED: sunrise upload {today_date_str}",
|
||||
f"Mattermost file upload failed: {response.status_code}"],
|
||||
check=False
|
||||
)
|
||||
else:
|
||||
print(f"No video file found at {final_video_file}.")
|
||||
subprocess.run(
|
||||
[str(_here / 'notify.sh'),
|
||||
f"FAILED: sunrise upload {today_date_str}",
|
||||
f"Video file not found: {final_video_file}"],
|
||||
check=False
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user