diff --git a/backend/app/plex/watch_sync.py b/backend/app/plex/watch_sync.py index 1ce461f6..96304701 100644 --- a/backend/app/plex/watch_sync.py +++ b/backend/app/plex/watch_sync.py @@ -432,10 +432,11 @@ def _repush_dirty(db: Session, plex: PlexClient, link: PlexLink) -> int: def run_plex_watch_sync(db: Session) -> dict: - """Scheduler job (default 30 min) — the cheap incremental pass. Pulls Plex-side changes since the - high-water mark (watch history + on-deck, filtered to the owner account) into Siftlode under - last-write-wins, then re-pushes any still-unsynced local states. Does NOT propagate un-watches - (the history feed only carries positive views) — that's `run_plex_watch_reconcile`'s job.""" + """Scheduler job (default 15 min) — the cheap incremental pass. Pulls Plex-side changes since the + high-water mark (watch history + on-deck, filtered to the owner account) into Siftlode, resolving a + divergence to Plex (the source of truth — see `_pull_apply`), then re-pushes any still-unsynced + local states. Does NOT propagate un-watches (the history feed only carries positive views) — that's + `run_plex_watch_reconcile`'s job.""" if not sysconfig.get_bool(db, "plex_enabled"): return {"skipped": "disabled"} total = {"links": 0, "watched": 0, "in_progress": 0, "repushed": 0} @@ -486,7 +487,7 @@ def run_plex_watch_sync(db: Session) -> dict: def run_plex_watch_reconcile(db: Session) -> dict: """Scheduler job (default daily) — the authoritative full reconcile. Rescans every section and, per item, uses `synced_to_plex` to settle what the incremental feed can't: - - Plex has a state, Siftlode differs → last-write-wins (Plex usually the newer here). + - Plex has a state, Siftlode differs → Plex wins (the source of truth — see `_pull_apply`). - Siftlode has a state, Plex has NO record: · synced_to_plex=True → Plex un-watched it since our last sync → clear it (un-watch). · synced_to_plex=False → a local change that never reached Plex → re-push it (via