Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
23 changes: 23 additions & 0 deletions seerr-api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4429,6 +4429,29 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/User'
/user/jellyfin/{jellyfinUserId}:
get:
summary: Get user by Jellyfin user ID
description: |
Retrieves user details by Jellyfin user ID in a JSON object. Returns filtered data based on the caller's permissions.
tags:
- users
parameters:
- in: path
name: jellyfinUserId
required: true
schema:
type: string
description: The Jellyfin user ID (32-character hexadecimal string)
responses:
'200':
description: User details in JSON
content:
application/json:
schema:
$ref: '#/components/schemas/User'
'404':
description: User not found
/user/{userId}/requests:
get:
summary: Get requests for a specific user
Expand Down
16 changes: 16 additions & 0 deletions server/routes/user/index.ts
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please run prettier on this file and fix the formatting issue

Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,22 @@ router.get<{ id: string }>('/:id', async (req, res, next) => {
}
});

router.get<{ jellyfinUserId: string }>('/jellyfin/:jellyfinUserId', async (req, res, next) => {
try {
const userRepository = getRepository(User);

const user = await userRepository.findOneOrFail({
where: { jellyfinUserId: req.params.jellyfinUserId },
});

return res
.status(200)
.json(user.filter(req.user?.hasPermission(Permission.MANAGE_USERS)));
} catch (e) {
next({ status: 404, message: 'User not found.' });
}
});

router.use('/:id/settings', userSettingsRoutes);

router.get<{ id: string }, UserRequestsResponse>(
Expand Down
Loading