fix(backend): fixes Jellyfin/Emby links if server is initially setup with a trailing /

Fixes #168 and #220
This commit is contained in:
Fallenbagel
2022-09-26 10:17:18 +05:00
parent e0f9a6e12f
commit 66357019f0
4 changed files with 28 additions and 7 deletions

View File

@@ -525,7 +525,10 @@ router.post(
email: jellyfinUser?.Name,
permissions: settings.main.defaultPermissions,
avatar: jellyfinUser?.PrimaryImageTag
? `${jellyfinHost}/Users/${jellyfinUser.Id}/Images/Primary/?tag=${jellyfinUser.PrimaryImageTag}&quality=90`
? new URL(
`/Users/${jellyfinUser.Id}/Images/Primary/?tag=${jellyfinUser.PrimaryImageTag}&quality=90`,
jellyfinHost
).href
: '/os_logo_square.png',
userType: UserType.JELLYFIN,
});