From dfb4dcbed29f2117668cae176ce8456dc1cf4782 Mon Sep 17 00:00:00 2001 From: sevenrats Date: Sun, 10 Sep 2023 14:48:55 -0400 Subject: [PATCH] make we found jellyfin and not emby --- source/utils/misc.brs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/source/utils/misc.brs b/source/utils/misc.brs index e7088c53a..2713a444d 100644 --- a/source/utils/misc.brs +++ b/source/utils/misc.brs @@ -189,7 +189,7 @@ function inferServerUrl(url as string) as string ' TODO ' if response code is a 300 redirect then we should return the redirect url ' Make sure this happens or make it happen - if resp.GetResponseCode() = 200 + if resp.GetResponseCode() = 200 and isJellyfinServer(resp.GetString()) selectedUrl = hosts.lookup(resp.GetSourceIdentity().ToStr()) print "Successfully inferred server URL: " selectedUrl return selectedUrl @@ -438,3 +438,11 @@ sub stopLoadingSpinner() m.scene.dialog.close = true end if end sub + +function isJellyfinServer(si as object) as boolean + d = ParseJson(si) + if isValid(d) and isValid(d.ProductName) + return d.ProductName = "Jellyfin Server" + end if + return False +end function