Skip to content

Commit

Permalink
fix(avatarproxy): add support for Emby avatars (#1128)
Browse files Browse the repository at this point in the history
Refactoring avatarproxy to retrieve avatars from the Jellyfin API instead of the public endpoint
broke Emby avatars that doesn't have this API method.

fix #1101
  • Loading branch information
gauthier-th authored Dec 3, 2024
1 parent 01bbece commit 17418f8
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions server/routes/avatarproxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,15 @@ router.get('/:jellyfinUserId', async (req, res) => {
default: 'mm',
size: 200,
});
const jellyfinAvatarUrl = `${getHostname()}/UserImage?UserId=${
req.params.jellyfinUserId
}`;

const setttings = getSettings();
const jellyfinAvatarUrl =
setttings.main.mediaServerType === MediaServerType.JELLYFIN
? `${getHostname()}/UserImage?UserId=${req.params.jellyfinUserId}`
: `${getHostname()}/Users/${
req.params.jellyfinUserId
}/Images/Primary?quality=90`;

let imageData = await avatarImageCache.getImage(
jellyfinAvatarUrl,
fallbackUrl
Expand Down

0 comments on commit 17418f8

Please # to comment.