Skip to content

feat(plex): add plex profiles user model#3271

Open
0xSysR3ll wants to merge 1 commit into
developfrom
0xsysr3ll/feat/plex-profile-model
Open

feat(plex): add plex profiles user model#3271
0xSysR3ll wants to merge 1 commit into
developfrom
0xsysr3ll/feat/plex-profile-model

Conversation

@0xSysR3ll

@0xSysR3ll 0xSysR3ll commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Description

#1594 ended up being a bit too large to review comfortably, so it has been split into three smaller, more focused PRs.

It introduces the foundation for profiles support by adding a new PLEX_PROFILE user type and the required user fields.

It also extends Plex TV API with support for listing Plex Home profiles, switching between profiles, and validating profile PINs.

In addition, it updates the Tautulli integration to use profile numeric IDs for managed profiles and adds Plex Profile badge in the user list and settings.

How Has This Been Tested?

Preview image, see #1627

Screenshots / Logs (if applicable)

Checklist:

  • I have read and followed the contribution guidelines.
  • Disclosed any use of AI (see our policy)
  • I have updated the documentation accordingly.
  • All new and existing tests passed.
  • Successful build pnpm build
  • Translation keys pnpm i18n:extract
  • Database migration (if required)

Summary by CodeRabbit

  • New Features
    • Added support for Plex home profiles, including profile discovery, switching, and PIN validation.
    • Plex profiles now show as a distinct account type in user lists and settings.
    • Added Plex profile identifiers to user data and improved watch statistics/history handling for Plex profiles.
    • Added Plex profile translations for English UI labels.
  • Database
    • Added storage for Plex profile identifiers (including main Plex user linkage) to both Postgres and SQLite.

@0xSysR3ll
0xSysR3ll requested a review from a team as a code owner July 20, 2026 17:00
@coderabbitai

coderabbitai Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Adds Plex Home profile schemas, persistence fields, profile retrieval and switching APIs, Tautulli identifier handling, and localized UI badges for the new PLEX_PROFILE user type.

Changes

Plex Home profiles

Layer / File(s) Summary
Profile contracts and persistence
seerr-api.yml, server/constants/user.ts, server/entity/User.ts, server/migration/...
Adds the PLEX_PROFILE type, Plex profile schemas and identifiers, and PostgreSQL/SQLite migrations for storing profile data.
Plex profile retrieval and switching
server/api/plextv.ts
Retrieves and parses Plex Home profiles, identifies protected and main profiles, supports profile switching and PIN validation, and adds a request timeout.
Tautulli profile ID resolution
server/api/tautulli.ts
Uses profile numeric IDs for watch statistics and history requests.
Plex profile account labels
src/components/UserList/index.tsx, src/components/UserProfile/..., src/i18n/locale/en.json
Displays localized warning badges for Plex profile accounts.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant PlexTvAPI
  participant PlexAccount
  participant PlexHomeAPI
  PlexTvAPI->>PlexAccount: Fetch main Plex user
  PlexTvAPI->>PlexHomeAPI: Request Plex Home users
  PlexHomeAPI-->>PlexTvAPI: Return XML profiles
  PlexTvAPI->>PlexTvAPI: Parse and classify profiles
Loading

Suggested reviewers: fallenbagel, gauthier-th

Poem

A rabbit hops through profiles bright,
Fetching home users in moonlit light.
IDs are stored, badges glow,
Tautulli finds the streams below.
PINs unlock the path ahead—
“Plex Profile,” softly said.

🚥 Pre-merge checks | ✅ 3 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning The PR covers Plex Home login and profile import groundwork, but it does not implement linked-account linking required by #1402. Add the linked-accounts flow to connect Plex Home profiles to Jellyseerr users, with selection and access-control handling.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the new Plex profile support work, though it omits the broader auth and import changes.
Out of Scope Changes check ✅ Passed The changes stay within Plex Home profile support across API, auth, UI, and migrations, with no unrelated scope apparent.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@server/api/plextv.ts`:
- Around line 361-385: Update the axios.post call in switchProfile to include
the same 10-second timeout used by getProfiles for clients.plex.tv requests,
ensuring hung external calls return control instead of blocking indefinitely.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: b134d251-5068-44d8-93dc-028b75e9553c

📥 Commits

Reviewing files that changed from the base of the PR and between 5ae70d0 and 4ad7b5b.

📒 Files selected for processing (10)
  • seerr-api.yml
  • server/api/plextv.ts
  • server/api/tautulli.ts
  • server/constants/user.ts
  • server/entity/User.ts
  • server/migration/postgres/1784565572362-AddPlexProfilesSupport.ts
  • server/migration/sqlite/1784565587819-AddPlexProfilesSupport.ts
  • src/components/UserList/index.tsx
  • src/components/UserProfile/UserSettings/UserGeneralSettings/index.tsx
  • src/i18n/locale/en.json

Comment thread server/api/plextv.ts
@0xSysR3ll
0xSysR3ll force-pushed the 0xsysr3ll/feat/plex-profile-model branch from 4ad7b5b to 0bb4e1a Compare July 20, 2026 17:09

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
seerr-api.yml (1)

317-340: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Specify required fields for the PlexProfile schema.

The PlexProfile TypeScript interface requires id, title, and thumb, but they are not listed as required in this OpenAPI schema. Adding them improves API documentation and client generation accuracy.

♻️ Proposed fix to add required fields
     PlexProfile:
       type: object
       properties:
         id:
           type: string
           example: '12345'
         numericId:
           type: number
           example: 12345
         title:
           type: string
           example: 'Family Member'
         username:
           type: string
           example: 'family_member'
         thumb:
           type: string
           example: 'https://plex.tv/users/avatar.jpg'
         isMainUser:
           type: boolean
           example: false
         protected:
           type: boolean
           example: true
+      required:
+        - id
+        - title
+        - thumb
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@seerr-api.yml` around lines 317 - 340, Update the PlexProfile schema’s
required-field declaration to include id, title, and thumb, matching the
corresponding required properties in the PlexProfile TypeScript interface. Leave
the other property definitions unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@seerr-api.yml`:
- Around line 317-340: Update the PlexProfile schema’s required-field
declaration to include id, title, and thumb, matching the corresponding required
properties in the PlexProfile TypeScript interface. Leave the other property
definitions unchanged.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: fc148d79-031e-4864-8c30-89d4c7a23ac7

📥 Commits

Reviewing files that changed from the base of the PR and between 4ad7b5b and 0bb4e1a.

📒 Files selected for processing (10)
  • seerr-api.yml
  • server/api/plextv.ts
  • server/api/tautulli.ts
  • server/constants/user.ts
  • server/entity/User.ts
  • server/migration/postgres/1784565572362-AddPlexProfilesSupport.ts
  • server/migration/sqlite/1784565587819-AddPlexProfilesSupport.ts
  • src/components/UserList/index.tsx
  • src/components/UserProfile/UserSettings/UserGeneralSettings/index.tsx
  • src/i18n/locale/en.json
🚧 Files skipped from review as they are similar to previous changes (8)
  • server/constants/user.ts
  • src/i18n/locale/en.json
  • src/components/UserProfile/UserSettings/UserGeneralSettings/index.tsx
  • server/migration/postgres/1784565572362-AddPlexProfilesSupport.ts
  • server/entity/User.ts
  • server/migration/sqlite/1784565587819-AddPlexProfilesSupport.ts
  • src/components/UserList/index.tsx
  • server/api/plextv.ts

@0xSysR3ll

Copy link
Copy Markdown
Contributor Author

@coderabbitai ignore pre-merge checks

@coderabbitai

coderabbitai Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor
ℹ️ Actions performed

Pre-merge checks override executed successfully.

Overridden by @0xSysR3ll via command on 2026-07-21T16:09:19.322Z.

Approval outcome: Approval skipped: request-changes workflow disabled.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add plex home linking

1 participant