Refactor EPG into shared engine with configurable TVJ channels
Build and Publish TVJ EPG Image / build (push) Successful in 29s

This commit is contained in:
Lyncoln
2026-09-10 09:49:40 -04:00
parent e6f8b0e512
commit af59324d99
13 changed files with 348 additions and 312 deletions
+8 -3
View File
@@ -3,11 +3,16 @@ set -eu
mkdir -p /app/output
UPDATE_INTERVAL="${UPDATE_INTERVAL:-6}"
export UPDATE_INTERVAL
UPDATE_INTERVAL="$(python -c 'import os; value = os.environ["UPDATE_INTERVAL"]; assert value.isascii() and value.isdigit() and int(value) > 0, "UPDATE_INTERVAL must be a positive integer (hours)"; print(int(value))')"
# Fail fast on invalid channel/output configuration.
python -c 'from epg.config import load; load()'
( while true; do
echo "$(date) - Updating TVJ EPG..."
python /app/tvj_epg.py
echo "$(date) - Sleeping for ${UPDATE_INTERVAL} hours..."
echo "$(date) - Updating EPG and playlist..."
if ! python -m epg.engine; then
echo "$(date) - Update failed; retrying after ${UPDATE_INTERVAL} hours." >&2
fi
sleep "$((UPDATE_INTERVAL * 3600))"
done
) &