fix(avatarproxy): add support for Emby avatars (#1128)

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
This commit is contained in:
Gauthier
2024-12-03 10:53:23 +01:00
committed by GitHub
parent 01bbeced65
commit 17418f82af

View File

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