Per-user YouTube sync (own channel per user) #7

Merged
troed merged 15 commits from multiuser into main 2026-08-08 20:05:44 +02:00
Owner

Converts the plugin from a single admin-managed YouTube channel to per-user sync: each PeerTube user connects their own YouTube channel from a new YouTube sync page (/my-account/p/peeryou) and their own published videos sync to it.

What changed

  • Storage: per-user OAuth tokens (peeryou-tokens-<userId>) and settings overrides (peeryou-settings-<userId>); pending/done queue entries stamped with userId; migrate() discards the legacy instance-wide peeryou-tokens on upgrade (users must reconnect).
  • Settings: global defaults stay admin-configurable; per-user overrides for delay, description suffix, min-privacy (empty field = use instance default).
  • Scheduler: per-job userId lookup; skips unconnected users' jobs without dropping them.
  • Backfill: per-user listing via /api/v1/users/me/videos with the caller's auth forwarded; POST validates the requested video ids against the caller's own eligible set (no cross-user uploads).
  • Routers: ensureAdminensureUser; new GET/POST /user-settings (merge-on-save so clearing one override preserves the rest) and POST /disconnect.
  • Client: new my-account scope client (connect/disconnect, per-user settings with diff-on-save, backfill); admin-settings client removed.
  • Docs: README describes per-user behavior; AGENTS.md refreshed.

Test plan

  • npm test — 16 suites / 153 tests pass
  • npm run build — both bundles produced
  • npm pack --dry-run — ships only dist/, src/, main.js, README.md
Converts the plugin from a single admin-managed YouTube channel to per-user sync: each PeerTube user connects their own YouTube channel from a new **YouTube sync** page (`/my-account/p/peeryou`) and their own published videos sync to it. ## What changed - **Storage:** per-user OAuth tokens (`peeryou-tokens-<userId>`) and settings overrides (`peeryou-settings-<userId>`); pending/done queue entries stamped with `userId`; `migrate()` discards the legacy instance-wide `peeryou-tokens` on upgrade (users must reconnect). - **Settings:** global defaults stay admin-configurable; per-user overrides for delay, description suffix, min-privacy (empty field = use instance default). - **Scheduler:** per-job `userId` lookup; skips unconnected users' jobs without dropping them. - **Backfill:** per-user listing via `/api/v1/users/me/videos` with the caller's auth forwarded; POST validates the requested video ids against the caller's own eligible set (no cross-user uploads). - **Routers:** `ensureAdmin` → `ensureUser`; new GET/POST `/user-settings` (merge-on-save so clearing one override preserves the rest) and POST `/disconnect`. - **Client:** new `my-account` scope client (connect/disconnect, per-user settings with diff-on-save, backfill); admin-settings client removed. - **Docs:** README describes per-user behavior; AGENTS.md refreshed. ## Test plan - `npm test` — 16 suites / 153 tests pass - `npm run build` — both bundles produced - `npm pack --dry-run` — ships only `dist/`, `src/`, `main.js`, `README.md`
troed merged commit 78617597c6 into main 2026-08-08 20:05:44 +02:00
troed deleted branch multiuser 2026-08-08 20:05:44 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
troed/peeryou!7
No description provided.