From 88c2c5ebcddd1eb8aea4a4e72c68a91197dec065 Mon Sep 17 00:00:00 2001 From: Shilong Jiang Date: Thu, 14 Apr 2022 20:10:57 +0800 Subject: [PATCH] feat: add emby detail url support --- server/entity/Media.ts | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/server/entity/Media.ts b/server/entity/Media.ts index ba65a99ad..77357b0fc 100644 --- a/server/entity/Media.ts +++ b/server/entity/Media.ts @@ -189,19 +189,14 @@ class Media { } } } else { + const pageName = + process.env.JELLYFIN_TYPE === 'emby' ? 'item' : 'details'; + const { hostname, serverId } = getSettings().jellyfin; if (this.jellyfinMediaId) { - this.mediaUrl = `${ - getSettings().jellyfin.hostname - }/web/index.html#!/details?id=${ - this.jellyfinMediaId - }&context=home&serverId=${getSettings().jellyfin.serverId}`; + this.mediaUrl = `${hostname}/web/index.html#!/${pageName}?id=${this.jellyfinMediaId}&context=home&serverId=${serverId}`; } if (this.jellyfinMediaId4k) { - this.mediaUrl4k = `${ - getSettings().jellyfin.hostname - }/web/index.html#!/details?id=${ - this.jellyfinMediaId4k - }&context=home&serverId=${getSettings().jellyfin.serverId}`; + this.mediaUrl4k = `${hostname}/web/index.html#!/${pageName}?id=${this.jellyfinMediaId4k}&context=home&serverId=${serverId}`; } } }