feat: web video transcoding, admin playback, and viewer fixes
CI / skip-ci-check (pull_request) Successful in 1m4s
CI / lint-and-type-check (pull_request) Has been cancelled
CI / python-lint (pull_request) Has been cancelled
CI / test-backend (pull_request) Has been cancelled
CI / build (pull_request) Has been cancelled
CI / secret-scanning (pull_request) Has been cancelled
CI / dependency-scan (pull_request) Has been cancelled
CI / sast-scan (pull_request) Has been cancelled
CI / workflow-summary (pull_request) Has been cancelled

Add on-demand H.264/AAC web playback (RQ, ffmpeg) with API routes and
Next.js proxies; extend admin UI with WebPlaybackVideo and shared hooks.
Store transcode cache beside pending-photos (WEB_VIDEO_CACHE_DIR / UPLOAD_DIR)
and ignore data/web_videos. Centralize FastAPI URL helpers, optional Vite
and Next base paths for subfolder deploy, and fix modal reopen by using
router.replace when closing the home photo viewer. Include migration,
install scripts, deployment doc updates, and CI admin build env tweak.

Made-with: Cursor
This commit is contained in:
Tanya
2026-03-25 15:33:05 -04:00
parent c316da02a4
commit ff47c87e41
45 changed files with 1531 additions and 121 deletions
+22
View File
@@ -0,0 +1,22 @@
#!/usr/bin/env bash
set -euo pipefail
PROJECT_ROOT="${PROJECT_ROOT:-$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)}"
cd "$PROJECT_ROOT"
if [[ ! -d "venv" ]]; then
echo "ERROR: venv/ not found at $PROJECT_ROOT/venv" >&2
exit 1
fi
echo "Activating venv and installing tf-keras."
source "venv/bin/activate"
python -V
pip -V
pip install -U tf-keras
echo
echo "Installed. Restart backend if needed (example):"
echo " pm2 restart punimtag-api --update-env"
+29
View File
@@ -0,0 +1,29 @@
#!/usr/bin/env bash
set -euo pipefail
echo "Installing ffmpeg on EL8 via RPM Fusion."
echo "This script is intended for AlmaLinux/Rocky/CentOS 8 with sudo access."
echo
if ! command -v dnf >/dev/null 2>&1; then
echo "ERROR: dnf not found. This doesn't look like an EL8 system." >&2
exit 1
fi
echo "Enabling PowerTools (if available)."
sudo dnf -y install dnf-plugins-core >/dev/null
sudo dnf -y config-manager --set-enabled powertools || true
sudo dnf -y config-manager --set-enabled PowerTools || true
echo "Installing RPM Fusion repos (EL8)."
sudo dnf -y install \
https://download1.rpmfusion.org/free/el/rpmfusion-free-release-8.noarch.rpm \
https://download1.rpmfusion.org/nonfree/el/rpmfusion-nonfree-release-8.noarch.rpm
echo "Installing ffmpeg."
sudo dnf -y install ffmpeg
echo
echo "Done. Verifying:"
command -v ffmpeg
ffmpeg -version | head -n 1
+41
View File
@@ -0,0 +1,41 @@
#!/usr/bin/env bash
# Run a SQL migration against the main DATABASE_URL from repo .env.
#
# Usage (from anywhere):
# ./scripts/run-psql-migration.sh migrations/add-photos-web-playback-columns.sql
#
# Strips SQLAlchemy driver suffixes (+psycopg2, +asyncpg) so psql accepts the URL.
# For remote Postgres, set DATABASE_URL in .env to postgresql://user:pass@host:port/dbname
set -euo pipefail
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
cd "$ROOT"
if [[ ! -f .env ]]; then
echo "ERROR: .env not found at $ROOT/.env" >&2
exit 1
fi
set -a
# shellcheck disable=SC1091
source .env
set +a
if [[ -z "${DATABASE_URL:-}" ]]; then
echo "ERROR: DATABASE_URL is not set in .env" >&2
exit 1
fi
SQL_FILE="${1:?Usage: $0 path/to/migration.sql}"
if [[ ! -f "$SQL_FILE" ]]; then
echo "ERROR: SQL file not found: $SQL_FILE" >&2
exit 1
fi
URL="$DATABASE_URL"
URL="${URL//+psycopg2/}"
URL="${URL//+asyncpg/}"
exec psql "$URL" -f "$SQL_FILE"