Timothy Pomeroy b63ce13163 Update READMEs, add data README, remove legacy code, move dev notes to docs 1 месяц назад
..
README.md b63ce13163 Update READMEs, add data README, remove legacy code, move dev notes to docs 1 месяц назад
database-test.db 7b7c4f0ac9 Initial commit 1 месяц назад
database.db b63ce13163 Update READMEs, add data README, remove legacy code, move dev notes to docs 1 месяц назад

README.md

Data Directory

This directory contains the SQLite databases used by the Watch Finished system.

Files

  • database.db - Main application database containing:

    • files table: Processed video files with metadata
    • tasks table: Video processing queue and task status
    • settings table: Application configuration and dataset settings
  • database.db.bak - Backup of the main database (created during migrations)

Database Schema

Files Table

CREATE TABLE files (
  dataset TEXT,      -- Dataset name (e.g., 'movies', 'tvshows')
  input TEXT,        -- Original file path
  output TEXT,       -- Processed file path
  status TEXT,       -- Processing status ('pending', 'processing', 'success', 'failed')
  date TEXT,         -- ISO timestamp of last update
  PRIMARY KEY (dataset, input)
);

Tasks Table

CREATE TABLE tasks (
  id INTEGER PRIMARY KEY AUTOINCREMENT,
  dataset TEXT,      -- Target dataset
  input TEXT,        -- Input file path
  output TEXT,       -- Output file path
  preset TEXT,       -- HandBrake preset used
  status TEXT,       -- Task status
  progress INTEGER,  -- Processing progress (0-100)
  created_at TEXT,   -- Creation timestamp
  updated_at TEXT    -- Last update timestamp
);

Settings Table

CREATE TABLE settings (
  key TEXT PRIMARY KEY,
  value TEXT         -- JSON-encoded setting value
);

Dataset Configuration

Dataset settings are stored in the settings table with keys like:

  • datasets/kids - Kids movies dataset configuration
  • datasets/pr0n - Adult content dataset configuration
  • datasets/tvshows - TV shows dataset configuration

Each dataset configuration includes:

  • enabled: Whether the dataset is active for watching
  • destination: Output directory for processed files
  • exts: File extensions to process
  • ext: Output file extension
  • preset: HandBrake encoding preset
  • clean: Filename cleaning rules

Backup and Recovery

  • Always backup database.db before major changes
  • The system creates database.db.bak during migrations
  • To restore from backup: cp database.db.bak database.db

Migration

The system includes migration tools to convert from the legacy JSON-based storage to SQLite. See the service README for migration commands.