refactor(server): share Jellyfin/Emby API implementations via ServerDialect#895
Open
MathiasDevelopes wants to merge 1 commit into
Open
Conversation
MathiasDevelopes
marked this pull request as ready for review
July 22, 2026 01:11
…ialect The Jellyfin and Emby API implementations were ~90% copy-pasted (~1,900 duplicated lines across 24 files). Both servers speak the same API with small, enumerable differences. - Add ServerDialect capturing auth scheme, user-scoped vs user-less endpoint paths, capability flags (QuickConnect, lyrics, media segments, remote subtitle search), api_key image auth and the per-server display-preferences client name. - Move the 12 duplicated API implementations into server_core as dialect-parameterized Server*Api classes. - Extract shared interceptor wiring (auth header, redirects, network logging) into attachServerInterceptors. - Both media server clients are now thin wiring shells; package names and client classes unchanged, so app code is untouched. Behavior unifications (previously drifted copies): - 5-min caches for user views and display preferences now apply to Jellyfin too (Emby already had them). - Ancestors and special-features lookups fail gracefully on both. - Jellyfin image/playback URLs resolve baseUrl lazily, fixing stale URLs after a server URL change. - Image query params are URL-encoded on both servers. Tests: twin playback/live_tv test pairs merged into server_core, plus a new dialect test pinning per-server paths and capability gates.
MathiasDevelopes
force-pushed
the
refactor/server-api-dedupe
branch
from
July 22, 2026 01:15
211a57a to
0f32624
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The Jellyfin and Emby API implementations were ~90% copy-pasted (~1,900 duplicated lines across 24 files). Both servers speak the same API with small, enumerable differences.
Behavior unifications (previously drifted copies):
Tests: twin playback/live_tv test pairs merged into server_core, plus a new dialect test pinning per-server paths and capability gates.
Pull Request
Summary
This PR deduplicates Jellyfin/Emby API logic, by consolidating common logic and storing the differences in a
ServerDialectclass.AI Assistance
Refactor plan and implementation were generated by Kimi K3 (Moonshot AI).
I spot-checked key files rather than reviewing the full diff line-by-line,
and tested the build against a Jellyfin and Emby server (see Test Steps).
Type of Change
Changes Made
Platform
Testing
Describe how this change was tested.
Test Steps
Tested Linux build against Jellyfin and Emby server, verified that login, library browsing, playback, favorites, and resume working.
Checklist