Files
SanctuaryCommander/TODO.md
T

4.5 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 and media-storage foundation; playback and device control are 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.
  • Implement static-image uploads that save a file and create a 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, or failed.
  • 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

  • Populate the home page with saved media and actionable playback buttons.
  • 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 FFPlay-based video and audio playback.
  • Display uploaded static images.
  • Play registered streams and apply stored playback options.
  • Support uploading and playing local video files.
  • Download YouTube videos ahead of time for later playback using queued jobs.
  • Implement a download worker that updates job status from pending to downloading to downloaded after 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_preparing flag; do not restore the old preparation table.
  • Implement background media preparation using the new tracking approach.
  • Surface preparation status in the web interface.
  • Track active and default media and implement their intended behavior.
  • 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.