Skip to content

Commit

Permalink
make we found jellyfin and not emby
Browse files Browse the repository at this point in the history
  • Loading branch information
sevenrats committed Sep 10, 2023
1 parent 481284a commit dfb4dcb
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion source/utils/misc.brs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

0 comments on commit dfb4dcb

Please sign in to comment.