soulsync/tests/automation
BoulderBadgeDad a16afd1f9e Post-download scan: wait until Plex's scan queue is actually idle, not a fixed 2min
A fixed debounce can't fit a big library — 8500 movies + 4500 shows scan sequentially
through Plex's queue and can take 10-20 min, so the old 120s wait read the DB before
Plex finished and fresh downloads showed up late. Now Stage 1 (video_scan_server)
fires the rescan then POLLS the server until its scan queue goes idle, then emits the
done event.

- sources: PlexVideoSource.is_scanning (section.refreshing + activity feed, scoped by
  media_type) and JellyfinVideoSource.is_scanning (scheduled-task state), plus
  video_server_scan_in_progress() returning True/False/None.
- handler: pure wait_for_server_scan(scan_status, sleep, …) — grace, then poll every
  interval until idle or a generous cap; falls back to the fixed wait only when the
  server can't report status (None). debounce_seconds is now that fallback; new
  max_wait_minutes caps the poll.

Seam tests for the poll logic (idle/poll/fallback/cap/lost-status), the handler wiring,
and Plex scan-status detection.
2026-06-21 13:44:52 -07:00
..
__init__.py Lift /api/automations/* into core/automation/ 2026-04-27 18:05:14 -07:00
test_automation_api.py Add owned_by column for Auto-Sync schedule ownership 2026-05-24 23:40:22 -07:00
test_automation_blocks.py video automations: post-download scan chain (parity with music's batch→scan→update) 2026-06-20 14:47:00 -07:00
test_automation_progress.py Lift /api/automations/* into core/automation/ 2026-04-27 18:05:14 -07:00
test_automation_signals.py Lift /api/automations/* into core/automation/ 2026-04-27 18:05:14 -07:00
test_engine_profile_context.py Automations: run each as its OWNER profile in the background (part 1 of per-profile sync) 2026-06-10 15:37:56 -07:00
test_engine_schedule_integration.py Video deep scans: fixed weekly times (TV Mon 2am, Movies Tue 2am) 2026-06-21 12:39:53 -07:00
test_handler_error_storage.py Harden playlist pipeline source refresh 2026-05-24 19:31:00 -07:00
test_handler_registration.py Video deep scan: pure read/reconcile, not a Plex disk-scan trigger 2026-06-21 13:27:55 -07:00
test_handler_video_scan_library.py Post-download scan: wait until Plex's scan queue is actually idle, not a fixed 2min 2026-06-21 13:44:52 -07:00
test_handlers_maintenance.py Remove old auto-acting Quality Scanner tool (replaced by Quality Upgrade Finder job) 2026-06-13 12:14:45 -07:00
test_handlers_personalized_pipeline.py Remove old auto-acting Quality Scanner tool (replaced by Quality Upgrade Finder job) 2026-06-13 12:14:45 -07:00
test_handlers_playlist.py Remove old auto-acting Quality Scanner tool (replaced by Quality Upgrade Finder job) 2026-06-13 12:14:45 -07:00
test_handlers_simple.py Remove old auto-acting Quality Scanner tool (replaced by Quality Upgrade Finder job) 2026-06-13 12:14:45 -07:00
test_playlist_pipeline_folder_mode.py Remove old auto-acting Quality Scanner tool (replaced by Quality Upgrade Finder job) 2026-06-13 12:14:45 -07:00
test_progress_callbacks.py Remove old auto-acting Quality Scanner tool (replaced by Quality Upgrade Finder job) 2026-06-13 12:14:45 -07:00
test_schedule.py Close three review gaps before PR 1 ships 2026-05-27 11:33:05 -07:00