diff --git a/app/login.tsx b/app/login.tsx index 0a4ac90d..420e47dd 100644 --- a/app/login.tsx +++ b/app/login.tsx @@ -3,6 +3,8 @@ import { Input } from "@/components/common/Input"; import { Text } from "@/components/common/Text"; import { apiAtom, useJellyfin } from "@/providers/JellyfinProvider"; import { Ionicons } from "@expo/vector-icons"; +import { PublicSystemInfo } from "@jellyfin/sdk/lib/generated-client"; +import { getSystemApi } from "@jellyfin/sdk/lib/utils/api"; import { useLocalSearchParams } from "expo-router"; import { useAtom } from "jotai"; import React, { useEffect, useState } from "react"; @@ -33,6 +35,7 @@ const Login: React.FC = () => { } = params as { apiUrl: string; username: string; password: string }; const [serverURL, setServerURL] = useState(_apiUrl); + const [serverName, setServerName] = useState(""); const [error, setError] = useState(""); const [credentials, setCredentials] = useState<{ username: string; @@ -117,6 +120,8 @@ const Login: React.FC = () => { }); clearTimeout(timeoutId); if (response.ok) { + const data = (await response.json()) as PublicSystemInfo; + setServerName(data.ServerName || ""); return `${protocol}${url}`; } } catch (e) { @@ -194,7 +199,9 @@ const Login: React.FC = () => { - Streamyfin + + {serverName || "Streamyfin"} + Server: {api.basePath} @@ -218,9 +225,6 @@ const Login: React.FC = () => { Log in - - Log in to any user account -