ReviewOS

home-lang/home-os

Media scanner and library database: incremental scan of sources, filename/NFO parsing, watched state, resume points, thumbnails, on-disk DB with crash safety

#102
Open chris opened this 8 days ago ·
8 days ago

Epic: #113 · Milestone: MC8 — Library & services

Why

The library is what turns a file player into a media center. Nothing exists. Own primitives: the VFS/ext2 (real), homefs later (S4), no database engine in Home yet.

Tasks

  • Storage: an append-only log + in-memory index (simple, crash-safe with checksummed records, compaction on boot) under /var/lib/tv/library/; schema versioning; ≤ 20 MB RAM for 10K items.
  • Scanner: enumerate configured sources (local, USB hot-plug, SMB/NFS), classify by extension + container probe (stdlib probe), parse names (Show.S01E02, Movie (2019), music tags via stdlib metadata: ID3/Vorbis comments/MP4 atoms), read .nfo sidecars, EXIF for photos; incremental by (path, size, mtime); background priority, pause during playback.
  • Derived data: thumbnails/I-frame previews for the scrubber, poster/backdrop cache keys, duration.
  • State: watched/unwatched, resume position, play count, last played, ratings; "Continue Watching"/"Next up" queries.
  • Shell tooling: tv-lib scan|stats|find for debugging over serial.

Acceptance

Scanning a 1,000-file fixture tree on the Pi completes ≤ 60 s from USB; DB survives a power cut mid-scan (rig power-cycle test) with no corruption.

Size: L · Depends on: #66, #68 (USB sources), #82 (probe/metadata) · Blocks: #93, #103

Sign in to comment on this issue.