- Source
Methods
(static) Delete() → {void}
Reset server to defaults
- Source
- Type:
- void
(static) Discover(redirectCountopt) → {object}
Discovers server information and handles redirects.
Convention: all API calls should go through the ApiClient class via GetApi() (for example GetApi().GetUser()). Those functions bundle APIRequest() with a synchronous execution strategy (getJson, postVoid, etc.).
Discover() is an intentional exception: it must intercept the roUrlEvent to read GetResponseHeaders() so it can detect and persist server-side redirects. The api.* wrappers use GetToString() which follows redirects silently, making the redirect URL undetectable. By calling APIRequest() directly and executing async, we get the same auth header and HTTPS certificate setup without losing the redirect headers.
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
redirectCount | integer | <optional> | 0 | Internal counter for tracking redirects (default: 0) |
- Source
Server info with Error field set on failure
- Type:
- object
(static) Populate() → {boolean}
Fetch and populate server info from Jellyfin API
- Source
- Type:
- boolean
(static) UpdateURL(url, originalUrlopt) → {boolean}
Update server URL and populate from API If not provided, the url parameter will be persisted. This preserves the user's input for multi-network access while allowing runtime discovery to use canonical URLs.
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
url | string | The URL to connect to (will be normalized for API calls) | ||
originalUrl | string | <optional> | "" | Optional: The original user-entered URL to persist to registry. |
- Source
- Type:
- boolean
(static) UrlToPersist(url, originalUrlopt) → {string}
The server URL to persist to the registry after a successful connection: the ORIGINAL URL (what the user entered), never the canonical one it was normalized or redirected to. Re-discovery then runs on every connection, so a canonical URL that only resolves on one network is never saved.
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
url | string | The URL UpdateURL was asked to connect to | ||
originalUrl | string | <optional> | "" | The user-entered URL, when the caller has one |
- Source
- Type:
- string