soulsync/core/automation/handlers
BoulderBadgeDad 40149d09f7 video automations: 'Scan Video Library' — the first video twin (shared engine)
The video side gets its OWN automations at music-side parity, kept separate so
nothing on the music side breaks. First twin: Scan Video Library — tells the media
server to rescan the user's SELECTED video sections (movies/TV, never music), then
reads the result into video.db so freshly-downloaded media shows as owned.

Architecture (scope tags + video twins on the shared engine):
- Handler core/automation/handlers/video_scan_library.py — pure function with
  injected I/O (server_refresh / run_video_scan); production lazily binds
  refresh_video_server_sections() + the video scanner. Owns its own progress.
  Lives on the SHARED automation side so it may import core.video (isolation only
  forbids core/video & api/video from importing music, not the reverse).
- blocks.py gains a 'scope' tag ('both' generic / 'video' video-only / absent=music)
  + blocks_for_scope(). The music /api/automations/blocks now filters out video
  blocks; new isolated /api/video/automations/blocks serves the video palette.
- automation_engine seeds 'Scan Video Library' (owned_by='video', schedule 6h) so
  it appears ONLY on the video Automations page; ensure_system_automations now
  honours owned_by + action_config. Music page excludes owned_by='video' rows.

kettui: seam-level tests for every handler path (happy/no-server/scan-error/never-
raises/mode), scope filtering (music excludes video, video gets generics, music
parity preserved), seeding (owned_by + mode), registration drift guard. 39 new
tests; full automation suite (288) + isolation guards green.
2026-06-19 19:38:18 -07:00
..
__init__.py Personalized playlist pipeline: auto-sync discover-page playlists 2026-05-15 18:41:08 -07:00
_pipeline_shared.py Fix organize-by-playlist downloads: library entries, wishlist, and stale Spotify cache 2026-06-03 10:26:32 +02:00
database_update.py Fix: deep-scan / DB-update automation falsely errors on large libraries (stall-based timeout) 2026-06-01 16:30:28 -07:00
discover_playlist.py Extract automation handlers (2/N): playlist lifecycle group 2026-05-15 10:47:46 -07:00
download_cleanup.py Extract automation handlers (3/3): maintenance + misc, finishing the lift 2026-05-15 11:24:35 -07:00
duplicate_cleaner.py Extract automation handlers (3/3): maintenance + misc, finishing the lift 2026-05-15 11:24:35 -07:00
maintenance.py DB backups: verify integrity + never evict the last good backup 2026-05-30 21:13:04 -07:00
personalized_pipeline.py Preserve personalized playlist metadata for wishlist 2026-05-15 21:50:32 -07:00
playlist_pipeline.py Move mirrored playlist pipeline into playlist domain 2026-05-24 19:44:13 -07:00
process_wishlist.py Extract automation handlers (1/N): infrastructure + 3 simple handlers 2026-05-15 10:25:41 -07:00
progress_callbacks.py Extract automation handlers (4/3 — finish): progress callbacks + scan-completion emitter 2026-05-15 11:59:32 -07:00
quality_scanner.py Remove old auto-acting Quality Scanner tool (replaced by Quality Upgrade Finder job) 2026-06-13 12:14:45 -07:00
refresh_mirrored.py Playlists: mirror-update trigger prunes removed tracks (the other half) 2026-06-12 15:49:13 -07:00
registration.py video automations: 'Scan Video Library' — the first video twin (shared engine) 2026-06-19 19:38:18 -07:00
run_script.py Extract automation handlers (3/3): maintenance + misc, finishing the lift 2026-05-15 11:24:35 -07:00
scan_library.py Extract automation handlers (1/N): infrastructure + 3 simple handlers 2026-05-15 10:25:41 -07:00
scan_watchlist.py Extract automation handlers (1/N): infrastructure + 3 simple handlers 2026-05-15 10:25:41 -07:00
search_and_download.py Extract automation handlers (3/3): maintenance + misc, finishing the lift 2026-05-15 11:24:35 -07:00
sync_playlist.py Mirrored playlists: custom name alias (overrides display + sync name, survives upstream refresh) — card rename button like the source-ref editor 2026-06-13 00:23:56 -07:00
video_scan_library.py video automations: 'Scan Video Library' — the first video twin (shared engine) 2026-06-19 19:38:18 -07:00