feat(plex): add plex profiles user model#3271
Conversation
📝 WalkthroughWalkthroughAdds Plex Home profile schemas, persistence fields, profile retrieval and switching APIs, Tautulli identifier handling, and localized UI badges for the new ChangesPlex Home profiles
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
Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (3 passed)
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. Comment |
There was a problem hiding this comment.
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
📒 Files selected for processing (10)
seerr-api.ymlserver/api/plextv.tsserver/api/tautulli.tsserver/constants/user.tsserver/entity/User.tsserver/migration/postgres/1784565572362-AddPlexProfilesSupport.tsserver/migration/sqlite/1784565587819-AddPlexProfilesSupport.tssrc/components/UserList/index.tsxsrc/components/UserProfile/UserSettings/UserGeneralSettings/index.tsxsrc/i18n/locale/en.json
4ad7b5b to
0bb4e1a
Compare
There was a problem hiding this comment.
🧹 Nitpick comments (1)
seerr-api.yml (1)
317-340: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueSpecify required fields for the
PlexProfileschema.The
PlexProfileTypeScript interface requiresid,title, andthumb, 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
📒 Files selected for processing (10)
seerr-api.ymlserver/api/plextv.tsserver/api/tautulli.tsserver/constants/user.tsserver/entity/User.tsserver/migration/postgres/1784565572362-AddPlexProfilesSupport.tsserver/migration/sqlite/1784565587819-AddPlexProfilesSupport.tssrc/components/UserList/index.tsxsrc/components/UserProfile/UserSettings/UserGeneralSettings/index.tsxsrc/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
|
@coderabbitai ignore pre-merge checks |
ℹ️ Actions performedPre-merge checks override executed successfully. Overridden by Approval outcome: Approval skipped: request-changes workflow disabled. |
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_PROFILEuser 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:
pnpm buildpnpm i18n:extractSummary by CodeRabbit