soulsync/core/video
BoulderBadgeDad 91eae710b4 video automations: post-download scan chain (parity with music's batch→scan→update)
Mirrors the music flow: a finished download batch → refresh the media server → (after
it indexes) pull the new media into the DB — so a downloaded movie/episode shows as
owned without waiting for the 6h scheduled scan.

Two event-based system automations (owned_by='video'):
  - 'Auto-Scan Video After Downloads' (video_batch_complete → video_scan_server)
  - 'Auto-Update Video Database After Scan' (video_library_scan_completed → video_update_database)

Pieces:
- core/video/download_events.py: a callback registry (core/video can't import the
  engine — isolation). The monitor publishes batch-complete; web_server bridges it to
  automation_engine.emit('video_batch_complete', …), like music's web_scan_manager.
- download_monitor: fires the batch-complete event once, when the last in-flight
  download finishes (none queued/downloading/searching left).
- video_scan_server handler (stage 1): refresh server, wait a debounce for indexing,
  then emit 'video_library_scan_completed' (mirrors music's time-based completion).
- video_update_database handler (stage 2): incremental read (newest-first, stop after
  25 consecutive known — same as music).
- blocks: 2 video triggers + 2 video actions (scope='video'); registration; seeds.

kettui: seam tests for both handlers (refresh/wait/emit, incremental read, error paths),
the event registry (idempotent register, isolated failures), and the monitor (fires once
on last completion, never while work remains). 298 automation tests + isolation green.
2026-06-20 14:47:00 -07:00
..
enrichment video scan: harden library scope + pause ALL enrichers during any scan 2026-06-20 13:24:57 -07:00
__init__.py video side: library scanner (server = source of truth) + scan API 2026-06-13 23:13:50 -07:00
download_config.py video downloads: reword download_config docstring (a wrapped line started with 'from the music side' — tripped the core/video no-music-import guard, a test false positive) 2026-06-19 00:25:57 -07:00
download_events.py video automations: post-download scan chain (parity with music's batch→scan→update) 2026-06-20 14:47:00 -07:00
download_monitor.py video automations: post-download scan chain (parity with music's batch→scan→update) 2026-06-20 14:47:00 -07:00
download_pipeline.py video downloads pipeline: data + pure logic foundation 2026-06-19 14:50:27 -07:00
mock_search.py video search: each source returns its own results (was identical) 2026-06-19 13:56:04 -07:00
quality_eval.py video search: evaluate/rank pipeline + mock indexer + /downloads/search 2026-06-19 13:39:09 -07:00
quality_profile.py video quality profile: loose resolution cutoff + movie/episode size split 2026-06-19 10:40:53 -07:00
release_parse.py video search: scene/p2p release-title parser (Sonarr-style) 2026-06-19 13:28:37 -07:00
retry.py video downloads Phase C: auto-retry + alternate-query requery 2026-06-19 17:12:44 -07:00
scanner.py video scan: show a 'cleaning up' phase during the deep-scan prune 2026-06-20 13:44:35 -07:00
slskd_download.py video downloads Phase A: cancelled state, cancel/retry, monitor robustness 2026-06-19 15:31:51 -07:00
slskd_search.py video search: poll the FULL slskd timeout (~60s) + explain audio-only results 2026-06-19 16:55:53 -07:00
sources.py video scan: harden library scope + pause ALL enrichers during any scan 2026-06-20 13:24:57 -07:00
youtube.py Playlist/channel extraction: stop pinning a static user_agent for yt-dlp 2026-06-17 22:21:12 -07:00
youtube_enrichment.py Remember each channel: cache the video catalog + metadata (instant re-open) 2026-06-17 18:08:04 -07:00
youtube_quality.py video downloads: separate YouTube quality profile (yt-dlp) 2026-06-19 10:45:38 -07:00