siftlode/backend/app/plex
npeter83 04fb3fb16e feat(plex): Phase A — one-time Plex→Siftlode watch-state import
Plex records watch state per Plex account; Siftlode per user in plex_states. A new plex_link table
maps a Siftlode user to a Plex account; for the owner (MVP) the row uses the server admin token
(uses_admin=True), so no separate Plex login. app/plex/watch_sync.py reads the owner account's
viewCount/viewOffset/lastViewedAt (already present in the catalog mirror's section listing) and
upserts them into the owner's plex_states — 'Plex is master' on this first import, but only where
Plex has a watch record (Siftlode-only states are preserved; union on the intersection). Idempotent.

Admin routes: GET/POST /api/plex/watch/link (status + enable/disable; first enable runs the import)
and POST /api/plex/watch/import (re-run). Migration 0051_plex_link. Two-way push (Phase B) and the
incremental Plex→Siftlode reconcile (Phase C) build on this in later ships.
2026-07-09 14:42:18 +02:00
..
__init__.py feat(plex): P0 backend foundations — catalog model, config, client 2026-07-05 01:35:08 +02:00
client.py feat(plex): Collections Phase 2 — admin collection editing (write-back to Plex) 2026-07-06 17:33:16 +02:00
paths.py feat(plex): P0 backend foundations — catalog model, config, client 2026-07-05 01:35:08 +02:00
stream.py feat(plex): multi-rendition audio (client-side switch) + reliable resume-on-F5 2026-07-08 22:25:03 +02:00
sync.py feat(plex): Collections Phase 2 — admin collection editing (write-back to Plex) 2026-07-06 17:33:16 +02:00
watch_sync.py feat(plex): Phase A — one-time Plex→Siftlode watch-state import 2026-07-09 14:42:18 +02:00