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 Plex Home profile support, including profile discovery, profile switching, and PIN validation.
    • Plex profiles now display as a distinct account type in user lists and settings.
  • UI / Localization
    • Added English labels for “Plex Profile”.
  • Database
    • Persisted Plex profile identifiers and main Plex user linkage in both Postgres and SQLite.
  • API / Schema
    • Extended the API schema to include new Plex profile identifier fields and the PLEX_PROFILE user type mapping.

@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

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 6d98ad70-0b6d-4e8c-8715-01445fe766db

📥 Commits

Reviewing files that changed from the base of the PR and between 6f44ecc and 70a05c6.

📒 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 (10)
  • server/constants/user.ts
  • src/i18n/locale/en.json
  • server/migration/postgres/1784565572362-AddPlexProfilesSupport.ts
  • src/components/UserProfile/UserSettings/UserGeneralSettings/index.tsx
  • src/components/UserList/index.tsx
  • server/entity/User.ts
  • server/api/tautulli.ts
  • server/migration/sqlite/1784565587819-AddPlexProfilesSupport.ts
  • seerr-api.yml
  • server/api/plextv.ts

📝 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 request timeouts.
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: gauthier-th, m0nsterrr

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 override applied

The pre-merge checks have been overridden successfully. You can now proceed with the merge.

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

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning Core Plex profile modeling and API support is added, but the linked-account linking and full auth/login flow for [#1402, #1594] are not implemented here. Add the missing linked-accounts association and auth-flow endpoint/UI changes for profile selection, PIN validation, import, and auto-request behavior.
✅ 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 is concise and accurately describes the main change: adding Plex profile user-model support.
Out of Scope Changes check ✅ Passed All changed files are directly related to Plex Home profile support, migrations, UI labels, or dependent Tautulli handling.

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.

@0xSysR3ll
0xSysR3ll force-pushed the 0xsysr3ll/feat/plex-profile-model branch 2 times, most recently from 0bb4e1a to 8069a63 Compare July 25, 2026 16:32

@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 `@seerr-api.yml`:
- Around line 137-148: Update the OpenAPI definitions for plexProfileId,
plexProfileNumericId, and mainPlexUserId to mark each field as nullable while
preserving their existing types, examples, and readOnly settings.
🪄 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 Plus

Run ID: dfdeb9f0-c5d3-4f02-8d1a-153da93e162e

📥 Commits

Reviewing files that changed from the base of the PR and between 0bb4e1a and 8069a63.

📒 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 (9)
  • server/constants/user.ts
  • src/i18n/locale/en.json
  • src/components/UserList/index.tsx
  • server/migration/postgres/1784565572362-AddPlexProfilesSupport.ts
  • server/entity/User.ts
  • src/components/UserProfile/UserSettings/UserGeneralSettings/index.tsx
  • server/api/tautulli.ts
  • server/migration/sqlite/1784565587819-AddPlexProfilesSupport.ts
  • server/api/plextv.ts

Comment thread seerr-api.yml
@0xSysR3ll
0xSysR3ll force-pushed the 0xsysr3ll/feat/plex-profile-model branch from 8069a63 to 6f44ecc Compare July 25, 2026 18:17
@0xSysR3ll
0xSysR3ll force-pushed the 0xsysr3ll/feat/plex-profile-model branch from 6f44ecc to 70a05c6 Compare July 25, 2026 18:37
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