Show course runtime on library cards via ffprobe
Add ffmpeg to the Docker image so ffprobe can read each video/audio file's duration server-side. Results are cached to a small persistent per-course JSON file keyed by (relative path, size, mtime), so a file only gets probed once - a container restart or the library scan's in-memory cache expiring never re-runs ffprobe on unchanged files. Course cards in the library browser (grid, list, and search) now show total runtime alongside the media-file count, so you know the time commitment before opening a course. Durations under a minute are suppressed rather than showing a noisy "0m". Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -4,6 +4,11 @@ FROM python:3.13.5-slim-bookworm
|
||||
# set the working directory in the container
|
||||
WORKDIR /app
|
||||
|
||||
# ffprobe (from ffmpeg) reads each video's duration for the library
|
||||
# browser's "how long is this course" display
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends ffmpeg \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# copy the dependencies file to the working directory
|
||||
COPY requirements.txt .
|
||||
|
||||
|
||||
Reference in New Issue
Block a user