Skip to content

refactor: use ServerType enum for media server display names - #3564

Open
rahul05ranjan wants to merge 1 commit into
seerr-team:developfrom
rahul05ranjan:chore/servertype-enum
Open

rahul05ranjan wants to merge 1 commit into
seerr-team:developfrom
rahul05ranjan:chore/servertype-enum

Conversation

@rahul05ranjan

@rahul05ranjan rahul05ranjan commented Sep 30, 2026 •

Copy link
Copy Markdown

Description

Adds PLEX to the ServerType enum and replaces the hardcoded 'Jellyfin' / 'Emby' / 'Plex' display-name strings across the frontend with the enum, so the media server name is defined in one place and typos can't drift in.

This is the follow-up refactor discussed in #3324 (the review comment asked to "stick to the 'Jellyfin' string" for that PR and open a separate one for the enum cleanup).

How Has This Been Tested?

  • pnpm exec tsc --noEmit (frontend) — passes
  • pnpm exec tsc --noEmit --project server/tsconfig.json (server) — passes
  • pnpm exec eslint on all changed files — passes
  • pnpm build:next — passes
  • pnpm build:server — passes
  • pnpm i18n:extract — passes (no new keys introduced by this change)

The change is a pure string-for-enum substitution; the rendered values are identical (ServerType.JELLYFIN === 'Jellyfin', etc.), so no visual change is expected.

Screenshots / Logs (if applicable)

N/A

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)

AI Disclosure: I used AI assistance to locate the hardcoded strings and draft the mechanical substitutions, then reviewed each change myself and verified with type-checking, lint, and a full build. The approach (add PLEX to ServerType, swap literals for the enum) was my own.

@rahul05ranjan
rahul05ranjan requested a review from a team as a code owner September 30, 2026 07:00
@coderabbitai

coderabbitai Bot commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 329fe350-35c8-4cda-96de-1d3947e0193d

📥 Commits

Reviewing files that changed from the base of the PR and between e959062 and 6faafc0.

📒 Files selected for processing (18)
  • server/constants/server.ts
  • src/components/IssueDetails/index.tsx
  • src/components/Login/LocalLogin.tsx
  • src/components/Login/index.tsx
  • src/components/ManageSlideOver/index.tsx
  • src/components/MovieDetails/index.tsx
  • src/components/PermissionEdit/index.tsx
  • src/components/Settings/SettingsJellyfin.tsx
  • src/components/Settings/SettingsLayout.tsx
  • src/components/Settings/SettingsPlex.tsx
  • src/components/Settings/SettingsUsers/index.tsx
  • src/components/StatusBadge/index.tsx
  • src/components/TvDetails/index.tsx
  • src/components/UserList/JellyfinImportModal.tsx
  • src/components/UserList/index.tsx
  • src/components/UserProfile/UserSettings/UserGeneralSettings/index.tsx
  • src/components/UserProfile/UserSettings/UserLinkedAccountsSettings/LinkJellyfinModal.tsx
  • src/components/UserProfile/UserSettings/UserLinkedAccountsSettings/LinkJellyfinQuickConnectModal.tsx

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

The change adds PLEX to ServerType and replaces hard-coded media-server names with enum values across playback, login, settings, user import, and account interfaces. Existing server-selection conditions and playback-label choices remain unchanged.

Changes

ServerType enum adoption

Layer / File(s) Summary
Playback and issue labels
server/constants/server.ts, src/components/IssueDetails/index.tsx, src/components/MovieDetails/index.tsx, src/components/TvDetails/index.tsx, src/components/StatusBadge/index.tsx
Adds ServerType.PLEX and uses ServerType values for media-server names in playback labels, issue details, and status messages. Existing conditions and fallbacks remain unchanged.
Login, management, and settings labels
src/components/Login/*, src/components/ManageSlideOver/index.tsx, src/components/PermissionEdit/index.tsx, src/components/Settings/*
Uses ServerType values in login hints, warnings, permission messages, settings views, and connection-error messages. Existing server-type selection behavior remains unchanged.
User imports and account labels
src/components/UserList/*, src/components/UserProfile/UserSettings/*
Uses ServerType values in user import messages, buttons, badges, and linked-account labels. Existing server-type selection behavior remains unchanged.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Refactor

Suggested reviewers: fallenbagel, gauthier-th

Merge Risk: ⚪ Minimal · up to 6faaf

This refactor preserves the displayed server names and their existing selection behavior, so no actionable merge-blocking risk is identified.

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The PR satisfies the coding objective in issue #3327. It adds ServerType.PLEX = 'Plex' and replaces hard-coded Jellyfin, Emby, and Plex display names with ServerType values across the changed fron…
Out of Scope Changes check ✅ Passed The changes stay within issue #3327. The enum addition and display-name replacements support the requested enum adoption. The changes do not introduce unrelated product behavior. The reported type-che…
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: replacing hard-coded media server display names with values from the ServerType enum.

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

A rabbit checks the server names,
And swaps the strings for enum claims.
Plex joins the list,
No labels are missed,
Then hops through the code without typos to chase.

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

@0xSysR3ll

Copy link
Copy Markdown
Member

In the future, please check for any open issues first, as someone from the team had already been assigned to this. See #3327

@rahul05ranjan

rahul05ranjan commented Oct 5, 2026 •

Copy link
Copy Markdown
Author

Thanks for pointing this out. I missed that #3327 was already assigned. I'll check existing issues and assignments before starting future contributions.

If the team decides to continue with this PR, Seerr CI and CodeQL are currently waiting for maintainer approval to run.

This branch has not been deployed

No deployments
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.

[Chore]: Use of ServerType enum across the codebase

2 participants