mirror of
https://github.com/streamyfin/streamyfin.git
synced 2026-06-05 05:28:37 +01:00
refactor(jellyseerr): keep the server version out of the field UI; enforce it at login
The resolver field only needs to find the working URL — the Jellyseerr version requirement is irrelevant there and only polluted the UI. - jellyseerrProbe: validate reachability + that it's a jellyseerr (no version gate, no version-too-low outcome). - Drop the version-too-low reason from the whole resolver stack (types, resolve, hook, status text, i18n). - Min version 2.0.0 stays enforced in JellyseerrApi.test() at login: now writes an error log + toast, and uses numeric isVersionBelow (fixes the "2.10.0" < "2.0.0" string-compare bug).
This commit is contained in:
@@ -18,8 +18,6 @@ interface ServerUrlFieldProps {
|
||||
label?: string;
|
||||
hint?: string;
|
||||
placeholder?: string;
|
||||
/** Shown in the "version too low" message. */
|
||||
minVersion?: string;
|
||||
editable?: boolean;
|
||||
resolveOptions?: ResolveOptions;
|
||||
}
|
||||
@@ -38,7 +36,6 @@ export function ServerUrlField({
|
||||
label,
|
||||
hint,
|
||||
placeholder,
|
||||
minVersion,
|
||||
editable = true,
|
||||
resolveOptions,
|
||||
}: ServerUrlFieldProps) {
|
||||
@@ -96,11 +93,7 @@ export function ServerUrlField({
|
||||
clearButtonMode='never'
|
||||
/>
|
||||
|
||||
<ServerUrlStatusText
|
||||
state={resolver}
|
||||
minVersion={minVersion}
|
||||
className='mt-2'
|
||||
/>
|
||||
<ServerUrlStatusText state={resolver} className='mt-2' />
|
||||
</View>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -10,11 +10,9 @@ import { Text } from "./Text";
|
||||
*/
|
||||
export function ServerUrlStatusText({
|
||||
state,
|
||||
minVersion,
|
||||
className = "",
|
||||
}: {
|
||||
state: ServerUrlResolverState;
|
||||
minVersion?: string;
|
||||
className?: string;
|
||||
}) {
|
||||
const { t } = useTranslation();
|
||||
@@ -41,16 +39,11 @@ export function ServerUrlStatusText({
|
||||
}
|
||||
|
||||
const message =
|
||||
state.reason === "version-too-low"
|
||||
? t("server_url.version_too_low", {
|
||||
version: state.version ?? "?",
|
||||
min: minVersion ?? "",
|
||||
})
|
||||
: state.reason === "wrong-service"
|
||||
? t("server_url.wrong_service")
|
||||
: state.reason === "invalid"
|
||||
? t("server_url.invalid_url")
|
||||
: t("server_url.unreachable");
|
||||
state.reason === "wrong-service"
|
||||
? t("server_url.wrong_service")
|
||||
: state.reason === "invalid"
|
||||
? t("server_url.invalid_url")
|
||||
: t("server_url.unreachable");
|
||||
|
||||
return <Text className={`text-xs text-red-500 ${className}`}>{message}</Text>;
|
||||
}
|
||||
|
||||
@@ -146,7 +146,6 @@ export const JellyseerrSettings = () => {
|
||||
onChangeText={setjellyseerrServerUrl}
|
||||
onResolved={(url) => setResolvedUrl(url)}
|
||||
probe={jellyseerrProbe}
|
||||
minVersion='2.0.0'
|
||||
label={t("home.settings.plugins.jellyseerr.server_url")}
|
||||
hint={t("home.settings.plugins.jellyseerr.server_url_hint")}
|
||||
placeholder={t(
|
||||
|
||||
Reference in New Issue
Block a user