fix(backend): fix jellyfinHost to not be undefined

Fix jellyfinHost so its not being treated as null or undefined

fix #237
This commit is contained in:
Fallenbagel
2022-10-16 03:50:22 +05:00
parent 0faae20bac
commit ab09664d41
4 changed files with 22 additions and 11 deletions

View File

@@ -204,12 +204,16 @@ class Media {
externalHostname && externalHostname.length > 0
? externalHostname
: hostname;
jellyfinHost = jellyfinHost.endsWith("/") ? jellyfinHost.slice(0, -1) : jellyfinHost;
jellyfinHost = jellyfinHost!.endsWith('/')
? jellyfinHost!.slice(0, -1)
: jellyfinHost;
if (this.jellyfinMediaId) {
this.mediaUrl = `${jellyfinHost}/web/index.html#!/${pageName}?id=${this.jellyfinMediaId}&context=home&serverId=${serverId}`;
}
if (this.jellyfinMediaId4k) {
this.mediaUrl4k = `${jellyfinHost}/web/index.html#!/${pageName}?id=${this.jellyfinMediaId4k}&context=home&serverId=${serverId}`;
this.mediaUrl4k = `${jellyfinHost}/web/index.html#!/${pageName}?id=${this.jellyfinMediaId}&context=home&serverId=${serverId}`;
}
}
}