Skip to content

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

Merged
fallenbagel merged 3 commits into
seerr-team:developfrom
rahul05ranjan:chore/servertype-enum
Nov 17, 2026
Merged

fallenbagel merged 3 commits into
seerr-team:developfrom
rahul05ranjan:chore/servertype-enum

Conversation

@rahul05ranjan

@rahul05ranjan rahul05ranjan commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

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.

Summary by CodeRabbit

  • New Features

    • Added Plex as a recognized media server, including in playback links, account settings, and user management.
  • Improvements

    • Standardized media-server names across playback links, login hints, settings, account linking, user management, and related messages. Plex, Jellyfin, and Emby are now labeled consistently wherever they appear.

@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

Explain Change →

No actionable comments were generated in the recent review.

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.

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

Change: Refactor

Suggested reviewers: fallenbagel, gauthier-th

Merge Risk: Minimal · up to 11967

This refactor replaces hard-coded Plex, Jellyfin and Emby names with enum values and is not expected to change what users see. No actionable merge risk remains.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names the main change: replacing hardcoded media server display-name strings with the ServerType enum, which the raw summary shows across many frontend components and adds PLEX to the enum. …
Linked Issues check Passed Issue #3327 asks for the ServerType enum to be used across the codebase and for Plex to be added to it. The change adds PLEX = 'Plex' to ServerType in server/constants/server.ts, which the summary est…
Out of Scope Changes check Passed Every listed change either replaces a display-name literal with a ServerType member, adds the PLEX member requested by #3327, or replaces the local LinkedAccountType enum with ServerType. The UserLink…
Full details: Title check

Explanation

The title names the main change: replacing hardcoded media server display-name strings with the ServerType enum, which the raw summary shows across many frontend components and adds PLEX to the enum. The 'refactor:' prefix is conventional and the title is short and specific.

Full details: Linked Issues check

Explanation

Issue #3327 asks for the ServerType enum to be used across the codebase and for Plex to be added to it. The change adds PLEX = 'Plex' to ServerType in server/constants/server.ts, which the summary establishes. The whole-PR diff of UserProfile/UserSettings/UserLinkedAccountsSettings/index.tsx confirms that the local LinkedAccountType enum is removed. Its account construction, linkable names, duplicate checks, logo selection, and unlink branch now use ServerType.PLEX, ServerType.JELLYFIN, and ServerType.EMBY. The values are identical, so behavior is unchanged. The summary reports the same literal-to-enum substitution in the other listed frontend components. The MovieDetails/index.tsx diff could not be read because its changed blobs are missing from the checkout. Its hunks are assessed only from the summary, which describes a substitution of playback-label names. The issue has no acceptance criteria, and the core requirements are met on the available evidence. The build and lint results are author-reported and were not rerun.

Full details: Out of Scope Changes check

Explanation

Every listed change either replaces a display-name literal with a ServerType member, adds the PLEX member requested by #3327, or replaces the local LinkedAccountType enum with ServerType. The UserLinkedAccountsSettings diff was read and shows only value-preserving substitutions, with no behavior change. The summary describes no unrelated product behavior in the other files. Limitation: the MovieDetails/index.tsx and TvDetails/index.tsx hunks (+19/-7 each) are described as playback-label substitutions. The MovieDetails diff could not be read, so its content is established only from the summary. No unrelated change is demonstrated.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Tip

👋 New to CodeRabbit? Try chatting in this PR!

Ask questions about the changes or discuss a review suggestion by mentioning @coderabbitai in a PR comment or a reply to a CodeRabbit review comment.

Try: @coderabbitai explain the changes in this PR and what I should focus on when reviewing.

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 constants’ claims.
Plex joins the list, in code now clear,
While Jellyfin and Emby stay near.
The labels hop along their way.

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 7fdd5157-8e03-40df-ac35-0c6a670a50da
Commits

Reviewing files that changed from the base of the PR and between 4e8ccf4 and 1196788.

Files selected for processing: 2

  • src/components/MovieDetails/index.tsx
  • src/components/TvDetails/index.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.

@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
Contributor 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.

@fallenbagel fallenbagel left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The swaps all look right, but one spot is missing. src/components/UserProfile/UserSettings/UserLinkedAccountsSettings/index.tsx has its own LinkedAccountType enum with the same three values as ServerType, plus name: 'Plex' / 'Jellyfin' / 'Emby' in the linkable list. Those need to use ServerType too.

…r linked accounts settings

Co-authored-by: rahul05ranjan <11793455+rahul05ranjan@users.noreply.github.com>
@rahul05ranjan

Copy link
Copy Markdown
Contributor Author

Thanks for catching that @fallenbagel — done in 4e8ccf4. The local LinkedAccountType enum in UserLinkedAccountsSettings/index.tsx is gone: the LinkedAccount type, the three accounts.push calls, the linkable entries (including the name values), the logo switch, and the unlink plex/jellyfin branch now all use ServerType from @server/constants/server. No other references to the old enum remain.

@github-actions github-actions Bot added the merge conflict Cannot merge due to merge conflicts label Nov 17, 2026
@github-actions

Copy link
Copy Markdown

This pull request has merge conflicts. Please resolve the conflicts so the PR can be successfully reviewed and merged.

Resolve conflicts between the ServerType enum refactor and
c22c266 (restore 4K label on Emby/Jellyfin play buttons):
keep the play4k message fix and apply ServerType enum values
to the mediaServerName arguments.

Co-authored-by: rahul05ranjan <11793455+rahul05ranjan@users.noreply.github.com>
@github-actions github-actions Bot removed the merge conflict Cannot merge due to merge conflicts label Nov 17, 2026
@rahul05ranjan

rahul05ranjan commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor Author

Merged develop in and resolved the conflicts (merge commit 11967883).

The conflicts were all in getAvailable4kMediaServerName() in MovieDetails/index.tsx and TvDetails/index.tsx, where 4e8ccf4's enum substitution met c22c266's 4K-label restore. The resolution keeps both: the messages.play4k fix and the ServerType.EMBY / ServerType.JELLYFIN values for mediaServerName, so the new play-button lines follow the enum refactor too. 9c34a81 (DNS cache settings) merged cleanly with no interaction.

Everything else is an additive merge — no force-push, no scope change. CI is green on the merge commit (lint, type-check/build, unit tests, Cypress, CodeQL, i18n).

@gauthier-th gauthier-th left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM, but please refrain from replying to us with a LLM.

@fallenbagel
fallenbagel merged commit 0ac0199 into seerr-team:develop Nov 17, 2026
16 checks passed
@rahul05ranjan

This comment was marked as off-topic.

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

6 participants