5.4 KiB
5.4 KiB
Sanctuary Commander TODO
Sanctuary Commander is the planned successor to Video Commander: a simple, web-based interface for managing sanctuary TVs and displaying dynamically added media. The current implementation provides the web interface, media storage, and an FFplay-based player with unified playback selection; device control is still future work.
Completed foundations
- Set up a Flask web server with configuration loaded from
config.json. - Organize implemented pages into Flask blueprints.
- Build a Bootstrap-based home page with controls grouped into common tools, playback, and media submission.
- Create the configured upload directory automatically when the server starts.
- Upload named static images (up to 100MB) to the configurable
Imagesfolder, show progress and navigation warnings, and return home after saving the file and media record. - Add browser-side upload progress reporting and basic upload error feedback.
- Implement stream registration with a display name and URL.
- Provide a SQLite database wrapper and a database initialization script.
- Define the media catalog and weighted playback-option tables.
- Add a YouTube download jobs table storing each URL and its status:
pending,downloading,downloaded, orfailed. - Store an optional fullscreen playback flag for registered streams.
- Remove the old preparation and component tables and slideshow scaffolding; retain the media and playback-option tables and their existing records.
Finish the current workflows
- Link the home page to a unified media library with Play buttons, live selection indicators, media-type icons, and cached local image/video thumbnails.
- Delete media with a confirmation step, removing records/playback options and unshared files in managed storage while preserving outside/shared sources.
- Connect the existing placeholder controls to backend actions.
- Add input validation for media names, duplicate names, stream URLs, and uploaded files.
- Ensure upload destinations remain inside the configured upload directory.
- Handle missing form fields, missing files, and storage/database failures with useful error messages.
- Close request-scoped database connections when requests finish.
Playback and media preparation
- Implement fullscreen FFPlay-based playback with error-only FFplay logging.
- Display uploaded static images when selected as active or default media.
- Play registered stream URIs using the player.
- Apply compatible stored playback options without overriding fullscreen or logging rules.
- Upload named local video files (up to 5GB) to the shared video storage folder, show upload progress and navigation warnings, and return home after saving.
- Play uploaded local video files when selected as active or default media.
- Download YouTube videos ahead of time for later playback using queued jobs.
- Implement a download worker that updates job status from
pendingtodownloadingtodownloadedafter the file is saved successfully. - Store requested media names on jobs and register successful downloads in the media catalog using the final local file path.
- Configure download storage (default:
Videos) and return failed attempts to pending for retry with logged errors. - Add a web workflow for submitting YouTube URLs and desired media names.
- List pending, downloading, and failed jobs, with an opt-in checkbox to include completed jobs.
- Persist per-job retry counts and mark jobs failed once they exceed the configured retry limit (default: three retries after the initial attempt).
- Add increasing retry backoff and recovery of jobs left downloading after a forced termination.
- Design a new approach to media preparation tracking, including the role of
the existing
media_preparingflag; do not restore the old preparation table. - Implement background media preparation using the new tracking approach.
- Surface preparation status in the web interface.
- Poll active/default media every two seconds, prioritizing active media and falling back to default media or a fullscreen black screen.
- Add web controls for changing active media atomically, with status matching the player's active/default priority.
- Add web controls for changing default media.
- Implement the Disable Video and Blackout Screen controls.
- Detect USB media and make it available for playback.
TV and device control
- Integrate with Home Assistant.
- Implement TV power controls.
- Implement TV volume controls.
- Implement TV input selection.
- Connect the home-page TV controls to the integration.
End goals and readiness
- Provide one browser-based location for TV control and media playback.
- Let users prepare and submit content dynamically rather than maintaining a static media configuration file.
- Keep everyday operation simple for less technically experienced users.
- Document installation, dependencies, configuration, and normal operation.
- Add automated coverage for upload, stream-registration, preparation, playback, and device-control workflows as they are implemented.
- Define appropriate access controls and a production deployment setup before exposing upload or device-control endpoints beyond a trusted environment.