Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ SeerrNG is maintained by snapetech as a separate fork so we can move quickly on
- [Configure comics](./docs/using-seerr/comics-backend.md)
- [Configure magazines](./docs/using-seerr/magazines-backend.md)
- [Companion services and SeerrNG NG forks](./docs/using-seerr/companion-services.md)
- [Add and import users](./docs/using-seerr/users/adding-users.mdx)
- [Why SeerrNG is a fork and what could retire it](./docs/fork-rationale.md)
- [Cross-platform setup assistant](./docs/using-seerr/setup-assistant.md)
- [Indexer searches by media category](./docs/using-seerr/indexer-searches.md)
Expand All @@ -59,6 +60,7 @@ SeerrNG is maintained by snapetech as a separate fork so we can move quickly on

- Requests and approvals for movies, shows, music, ebooks, audiobooks, comics, magazines, emulation ROMs, and PC games.
- Media-server integration with Plex, Jellyfin, and Emby, including watch-state-aware My Library views scoped to each linked account.
- Optional Jellyfin and Emby profile sync during user imports, refreshing linked provider names and avatars while preserving SeerrNG email addresses, local passwords, and permissions.
- Automation service integration with Radarr, Sonarr, Lidarr, and Bookshelf/Readarr-compatible APIs.
- Admin-configured Prowlarr connection, per-indexer diagnostics, category coverage, and format-aware manual search across movies, TV, music, books, comics, magazines, ROMs, and PC games, with title-prefilled search links from media details; approved requests still go through their configured acquisition providers.
- Music discovery and metadata through MusicBrainz, ListenBrainz, Cover Art Archive, TheAudioDB, and archive-backed artwork sources.
Expand Down
85 changes: 85 additions & 0 deletions cypress/e2e/user/user-list.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,4 +110,89 @@ describe('User List', () => {
expect(settings.sortDirection).to.equal('asc');
});
});

it('refreshes selected linked media-server users only after opting in', () => {
const importedUserId = '88888888888888888888888888888888';
const newUserId = '99999999999999999999999999999999';

cy.intercept('GET', '/api/v1/settings/public', (request) => {
request.continue((response) => {
// MediaServerType.JELLYFIN; keep this browser test isolated from the configured provider.
response.body.mediaServerType = 2;
});
});
cy.intercept('GET', '/api/v1/settings/jellyfin/users', {
statusCode: 200,
body: [
{
id: importedUserId,
username: 'Linked Jellyfin User',
thumb: '/user-icon-192x192.png',
email: 'linked@example.com',
isImported: true,
},
{
id: newUserId,
username: 'New Jellyfin User',
thumb: '/user-icon-192x192.png',
email: 'new@example.com',
isImported: false,
},
],
}).as('jellyfinUsers');
cy.intercept('POST', '/api/v1/user/import-from-jellyfin', {
statusCode: 201,
body: { createdUsers: [], refreshedUsers: 1 },
}).as('jellyfinImport');

cy.visit('/users');
cy.contains('button', /Import (Jellyfin|Emby) Users/).click();
cy.wait('@jellyfinUsers');

cy.get('[data-testid=jellyfin-sync-existing]').should('not.be.checked');
cy.get(`[data-testid=jellyfin-import-user-${importedUserId}]`).should(
'not.exist'
);
cy.get(`[data-testid=jellyfin-import-user-${newUserId}]`).should('exist');
cy.get(
`[data-testid=jellyfin-import-user-${newUserId}] svg.cached-image-avatar-fallback`
)
.should('have.attr', 'width', '20')
.and('have.attr', 'height', '20');
cy.get(
`[data-testid=jellyfin-import-user-${newUserId}] svg.cached-image-avatar-fallback`
).should(($icon) => {
expect(($icon[0] as SVGSVGElement).getBoundingClientRect()).to.include({
width: 20,
height: 20,
});
});

cy.get('[data-testid=jellyfin-sync-existing]').check();
cy.get(
`[data-testid=jellyfin-user-import-status-${importedUserId}]`
).should('contain', 'Already Imported');
cy.get(
`[data-testid=jellyfin-import-user-${importedUserId}] svg.cached-image-avatar-fallback`
)
.should('have.attr', 'width', '20')
.and('have.attr', 'height', '20');
cy.get(
`[data-testid=jellyfin-import-user-${importedUserId}] svg.cached-image-avatar-fallback`
).should(($icon) => {
expect(($icon[0] as SVGSVGElement).getBoundingClientRect()).to.include({
width: 20,
height: 20,
});
});
cy.get(`[data-testid=jellyfin-select-user-${importedUserId}]`).click();
cy.get('[data-testid=modal-ok-button]').click();

cy.wait('@jellyfinImport').then(({ request }) => {
expect(request.body).to.deep.equal({
jellyfinUserIds: [importedUserId],
syncExisting: true,
});
});
});
});
7 changes: 4 additions & 3 deletions docs/maintainers/ui-fix-it.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@ Use [UI Style Standard](ui-style-standard.md) as the target contract. This file
3. Trace headings and titles through their typography roles and active translations/generated helpers. Detect Title Case and punctuation drift by role. Do not create checks keyed to exact example titles, badges, message strings or media names.
4. Search Tailwind use in JSX and styles, including `@apply`, utility aliases, generated `--tw-*` machinery and nested state/media rules. A zero literal-utility count in one component is not a completed dependency audit or native-CSS conversion.
5. Map each observed presentation property to its existing shared owner. Include typography, dimensions, padding/gap/margins, alignment, ratio/crop, border/surface, icon geometry, state effects, transitions, scrollbars and breakpoints.
6. Distinguish external/native classes and meaningful data geometry from presentation utilities. Country flags, provider branding, portrait/mosaic arrangements, runtime pointer bounds and native identifiers are not automatically removable because their names look unfamiliar.
7. Follow source/generated reference relationships and active palette/mode variants. Preserve opt-in reference pages; do not audit a generated preview as if it were the only source or silently adopt its experimental style.
8. Include loading placeholders in the asset inventory. Trace both whole-section loading and per-item lazy/partial metadata branches to the card family they replace. Compare them with established loaded examples at the family's breakpoints; do not assume a shared placeholder component selects the correct variant in every caller.
6. For avatar consumers, inspect both loaded and fallback states at the requested size. Compare the rendered fallback box with its caller-owned dimensions; SVG width/height attributes alone do not prove that padding or other CSS kept the glyph contained.
7. Distinguish external/native classes and meaningful data geometry from presentation utilities. Country flags, provider branding, portrait/mosaic arrangements, runtime pointer bounds and native identifiers are not automatically removable because their names look unfamiliar.
8. Follow source/generated reference relationships and active palette/mode variants. Preserve opt-in reference pages; do not audit a generated preview as if it were the only source or silently adopt its experimental style.
9. Include loading placeholders in the asset inventory. Trace both whole-section loading and per-item lazy/partial metadata branches to the card family they replace. Compare them with established loaded examples at the family's breakpoints; do not assume a shared placeholder component selects the correct variant in every caller.

## 3. Find ownership and layout regressions

Expand Down
1 change: 1 addition & 0 deletions docs/maintainers/ui-style-standard.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ The rules describe asset roles, not particular pages, title strings, example med
8. Primary navigation: `sidebar-navigation`, `sidebar-navigation-section`, `sidebar-navigation-heading`, `sidebar-navigation-items`, and `main-menu-link`. Desktop, the mobile drawer, and the mobile bottom menu consume one ordered route model; route availability and permission checks stay attached to each link. Section headings and nested items express grouping without changing a route's access rules.
9. Messages and recovery: `page-error-message` and the shared Retry action. Selection: `selection-circle`; hierarchical selection: `selection-tree` together with table/card roles.
10. Software catalog ownership uses the catalog library badge with the shared compact badge geometry. Play-time estimates use the dedicated readable text role within the existing card-table layout.
11. Cached avatar fallbacks use the caller's avatar dimensions and the shared `cached-image-avatar-fallback` icon color role. Keep their glyph inside that box; percentage padding resolves against the surrounding layout and can expand the avatar beyond its requested size.

This map identifies owners, not a whitelist of every valid class. Follow the existing family for the asset and verify its cascade before proposing another family.

Expand Down
4 changes: 4 additions & 0 deletions docs/using-seerr/users/adding-users.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ import TabItem from '@theme/TabItem';
<TabItem value="jellyfin" label="Jellyfin">
Clicking the **Import Jellyfin Users** button on the **User List** page will fetch the list of users with access to the Jellyfin server and add them to Seerr automatically.

To refresh an account that is already linked, turn on **Sync Existing Users** before selecting users to import. This option is off by default. It refreshes the Jellyfin username and profile photo while preserving the SeerrNG email address, local username and password, and permissions. New and linked users can be selected in the same import.

Importing Jellyfin users is not required, however. Any user with access to the Jellyfin server can log in to Seerr even if they have not been imported, and will be assigned the configured [default permissions](/using-seerr/settings/users#default-permissions) upon their first login.

:::tip
Expand All @@ -27,6 +29,8 @@ To disable new Jellyfin sign-ins, navigate to **Settings &rarr; Users** and unch
<TabItem value="emby" label="Emby">
Clicking the **Import Emby Users** button on the **User List** page will fetch the list of users with access to the Emby server and add them to Seerr automatically.

To refresh an account that is already linked, turn on **Sync Existing Users** before selecting users to import. This option is off by default. It refreshes the Emby username and profile photo while preserving the SeerrNG email address, local username and password, and permissions. New and linked users can be selected in the same import.

Importing Emby users is not required, however. Any user with access to the Emby server can log in to Seerr even if they have not been imported, and will be assigned the configured [default permissions](/using-seerr/settings/users#default-permissions) upon their first login.

:::tip
Expand Down
9 changes: 9 additions & 0 deletions release-notes/jellyfin-emby-user-import-sync.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
category: changed
audience: users, operators
area: user-management
action: none
breaking: false
---

Administrators can refresh linked Jellyfin and Emby usernames and profile photos while importing users. SeerrNG email addresses, local credentials, and permissions remain unchanged. Fallback profile icons keep the requested avatar size so missing photos do not push user names out of alignment.
31 changes: 26 additions & 5 deletions seerr-api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7598,6 +7598,9 @@ paths:
type: string
email:
type: string
isImported:
type: boolean
description: Whether this media server account is already linked to a SeerrNG user.
/settings/jellyfin/sync:
get:
summary: Get status of full Jellyfin library sync
Expand Down Expand Up @@ -11879,7 +11882,9 @@ paths:
post:
summary: Import all users from Jellyfin
description: |
Fetches and imports users from the Jellyfin server.
Fetches selected users from the configured Jellyfin or Emby server and imports any accounts not already linked.

When `syncExisting` is true, linked users are also refreshed. Only the provider username and avatar are updated; SeerrNG email, local credentials, and permissions are preserved. This opt-in mode returns created and refreshed counts. Requests that omit `syncExisting` keep the legacy array response.

Requires the `MANAGE_USERS` permission.
tags:
Expand All @@ -11895,15 +11900,31 @@ paths:
type: array
items:
type: string
syncExisting:
type: boolean
description: Refresh provider usernames and avatars for selected users already linked to SeerrNG.
responses:
'201':
description: A list of the newly created users
description: Newly created users, or created users and a refreshed count when syncExisting is true.
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/User'
oneOf:
- type: array
items:
$ref: '#/components/schemas/User'
- type: object
required:
- createdUsers
- refreshedUsers
properties:
createdUsers:
type: array
items:
$ref: '#/components/schemas/User'
refreshedUsers:
type: integer
minimum: 0
/user/registerPushSubscription:
post:
summary: Register a web push /user/registerPushSubscription
Expand Down
29 changes: 23 additions & 6 deletions server/routes/settings/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ import { mapWithConcurrency } from '@server/utils/concurrency';
import { dnsCache } from '@server/utils/dnsCache';
import { getHostname } from '@server/utils/getHostname';
import { parseListenPort } from '@server/utils/httpServer';
import { normalizeJellyfinGuid } from '@server/utils/jellyfin';
import { parsePageParams } from '@server/utils/pagination';
import { parsePositiveRouteId } from '@server/utils/routeId';
import {
Expand Down Expand Up @@ -2099,12 +2100,28 @@ settingsRoutes.get('/jellyfin/users', async (req, res) =>

jellyfinClient.setUserId(admin.jellyfinUserId ?? '');
const resp = await jellyfinClient.getUsers();
const jellyfinUsers = resp.users.map((user) => ({
username: user.Name,
id: user.Id,
thumb: `/avatarproxy/${user.Id}`,
email: user.Name,
}));
const importedUserRows = await userRepository.find({
select: { jellyfinUserId: true },
});
const importedUserIds = new Set(
importedUserRows
.map((user) => normalizeJellyfinGuid(user.jellyfinUserId))
.filter((userId): userId is string => Boolean(userId))
);
const jellyfinUsers = resp.users.flatMap((user) => {
const id = normalizeJellyfinGuid(user.Id);
if (!id) return [];

return [
{
username: user.Name,
id,
thumb: `/avatarproxy/${id}`,
email: user.Name,
isImported: importedUserIds.has(id),
},
];
});

return res.status(200).json(jellyfinUsers);
})
Expand Down
71 changes: 71 additions & 0 deletions server/routes/settingsIndex.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import PlexAPI from '@server/api/plexapi';
import PlexTvAPI, { MAX_PLEX_SHARED_USERS } from '@server/api/plextv';
import TautulliAPI from '@server/api/tautulli';
import { MediaServerType } from '@server/constants/server';
import { UserType } from '@server/constants/user';
import { getRepository } from '@server/datasource';
import { ScheduledJobLease } from '@server/entity/ScheduledJobLease';
import { User } from '@server/entity/User';
Expand Down Expand Up @@ -262,6 +263,76 @@ describe('Settings route input validation', () => {
assert.strictEqual(res.body.message, 'Jellyfin is not configured.');
});

it('returns canonical Jellyfin IDs and server-side import status', async () => {
const settings = getSettings();
const previousJellyfin = settings.jellyfin;
const providerId = '66666666-6666-6666-6666-666666666666';
const canonicalId = providerId.replaceAll('-', '');
const userRepository = getRepository(User);
const linkedUser = await userRepository.save(
new User({
email: 'linked-jellyfin-import@example.com',
jellyfinUserId: providerId,
jellyfinUsername: 'Linked Jellyfin User',
permissions: Permission.REQUEST,
userType: UserType.LOCAL,
avatar: `/avatarproxy/${canonicalId}`,
})
);
settings.jellyfin = {
...settings.jellyfin,
ip: 'jellyfin.local',
apiKey: 'stored-key',
};
const getUsersMock = mock.method(
JellyfinAPI.prototype,
'getUsers',
async () =>
({
users: [
{
Name: 'Linked Jellyfin User',
Id: providerId,
},
{
Name: 'New Jellyfin User',
Id: '77777777-7777-7777-7777-777777777777',
},
{
Name: 'Invalid ID',
Id: 'not-a-guid',
},
],
}) as never
);

try {
const response = await request(app).get('/settings/jellyfin/users');

assert.strictEqual(response.status, 200);
assert.deepStrictEqual(response.body, [
{
username: 'Linked Jellyfin User',
id: canonicalId,
thumb: `/avatarproxy/${canonicalId}`,
email: 'Linked Jellyfin User',
isImported: true,
},
{
username: 'New Jellyfin User',
id: '77777777777777777777777777777777',
thumb: '/avatarproxy/77777777777777777777777777777777',
email: 'New Jellyfin User',
isImported: false,
},
]);
} finally {
settings.jellyfin = previousJellyfin;
await userRepository.delete(linkedUser.id);
getUsersMock.mock.restore();
}
});

it('does not use Jellyfin credentials removed before admission', async () => {
const settings = getSettings();
settings.jellyfin = {
Expand Down
Loading
Loading