ApiClient. ApiClient

ApiClient provides a centralized, stateful wrapper around the Jellyfin API. It automatically injects image parameters and version-specific fields for consistent, bulletproof item fetching across all Jellyfin server versions (10.7.0+).

The singleton pattern ensures one instance is shared across the entire app.

Constructor

new ApiClient() → {ApiClient}

Returns:
Type: 
ApiClient

Methods

AuthenticateByName(username, password) → {dynamic}

Authenticate user by username and password

Parameters:
NameTypeDescription
usernamestring

User's username

passwordstring

User's password

Returns:

API response with auth token or invalid on error

Type: 
dynamic

BuildAuthenticateWithQuickConnectRequest(secret) → {dynamic}

Build a request AA to exchange an APPROVED Quick Connect secret for an auth token, for use with fetchAsync() / fetchRes().

The body's field name changed at 10.8.0, a FINER boundary than the V1/V2 apiVersion split, so it reads the server version directly rather than m.getApiVersion(): 10.7.x: { "Token": secret } (QuickConnectDto.Token, required) 10.8.0+: { "Secret": secret } (QuickConnectDto.Secret, required) Confirmed against every published spec from 10.7.0 to 10.11.8: the rename lands at exactly 10.8.0, with no version carrying both names.

DON'T BRANCH ON THE ERROR CODE HERE. The spec declares only 400 ("Missing token") plus 503 from 10.11.0, but a live 10.11.11 answered 404 for a secret it had not seen approved, an undeclared code. So a non-ok response means "this secret cannot be exchanged" and nothing finer; quickConnectExchangeFailure (source/utils/quickConnect.bs) owns the one distinction worth making.

Parameters:
NameTypeDescription
secretstring

The Quick Connect secret from Initiate

Returns:

Request AA: { method, url, body, headers } or invalid if server URL not set

Type: 
dynamic

BuildCancelSeriesTimerRequest(timerId) → {dynamic}

Build a request AA to cancel a Live TV series recording timer, for use with SubmitSideEffect().

Parameters:
NameTypeDescription
timerIdstring

The series timer ID to cancel

Returns:

Request AA: { method, url } or invalid if server URL not set

Type: 
dynamic

BuildCancelTimerRequest(timerId) → {dynamic}

Build a request AA to cancel a Live TV recording timer, for use with SubmitSideEffect().

Parameters:
NameTypeDescription
timerIdstring

The timer ID to cancel

Returns:

Request AA: { method, url } or invalid if server URL not set

Type: 
dynamic

BuildCloseLiveStreamRequest(liveStreamId) → {dynamic}

Build a request AA to close a live stream the server opened for PlaybackInfo, for use with SubmitSideEffect(). Each close releases one consumer; the server closes the stream when none remain. The same endpoint and query on every supported server (10.7.0 through 12.x).

Parameters:
NameTypeDescription
liveStreamIdstring

The media source's LiveStreamId

Returns:

Request AA: { method, url } or invalid if the id is empty or no server URL is set

Type: 
dynamic

BuildConnectQuickConnectRequest(secret) → {dynamic}

Build a request AA to poll whether a Quick Connect secret has been approved, for use with fetchAsync() / fetchRes(). Responds 200 with the same QuickConnectResult shape Initiate returned, its Authenticated flag now true once someone approved the code.

An UNKNOWN or EXPIRED secret answers 404 ("Unknown quick connect secret"), declared by every published spec from 10.7.0 to 10.11.8 and corroborated by a live 10.11.11. That is the only signal separating "not approved yet" from "this code is dead", and it is invisible to a caller that only parses the body, which is why this endpoint has to go through the pool (res.statusCode) rather than a sync JSON helper.

Parameters:
NameTypeDescription
secretstring

The Quick Connect secret from Initiate

Returns:

Request AA: { method, url } or invalid if server URL not set

Type: 
dynamic

BuildCreateSeriesTimerRequest(defaults) → {dynamic}

Build a request AA to create a Live TV series recording timer, for use with fetchRes() or fetchJson().

Parameters:
NameTypeDescription
defaultsobject

Timer defaults AA from BuildGetLiveTvTimerDefaultsRequest response

Returns:

Request AA: { method, url, body, headers } or invalid if server URL not set

Type: 
dynamic

BuildCreateTimerRequest(defaults) → {dynamic}

Build a request AA to create a Live TV recording timer, for use with fetchRes() or fetchJson().

Parameters:
NameTypeDescription
defaultsobject

Timer defaults AA from BuildGetLiveTvTimerDefaultsRequest response

Returns:

Request AA: { method, url, body, headers } or invalid if server URL not set

Type: 
dynamic

BuildDeleteItemRequest(itemId) → {dynamic}

Build a request AA to delete an item, for use with SubmitSideEffect().

Parameters:
NameTypeDescription
itemIdstring

The item ID to delete

Returns:

Request AA: { method, url }

Type: 
dynamic

BuildDeleteSubtitleRequest(itemId, stream) → {dynamic}

Build a request AA to delete an EXTERNAL subtitle file from an item, for use with fetchRes().

It takes the stream, not an index, and that is the point. The server deletes MediaStream.Path unconditionally, and for an EMBEDDED stream that path is the media container, so aiming this at the wrong stream destroys the user's movie, not a subtitle. This used to accept a bare integer and warn the caller in prose to check IsExternal first. Prose is not a guard: the subtitle panel's list was ALSO external-only at the time, so the safety rested on two separate places staying in agreement, and the moment that list grew to include embedded streams (so it could describe the item honestly) the only thing standing between a mis-wired row and a deleted container was a comment. Requiring the stream means the check happens here, once, and cannot be forgotten by a future caller.

A non-external stream returns INVALID rather than raising: callers already treat an invalid request as "cannot do this" (validatedReq does the same when no server URL is set), so refusing degrades into an inert button instead of a crash.

The one hazard left with the caller: Index must come from a FRESH item fetch. A download inserts a subtitle at index 0 and renumbers every other stream, so a stale index deletes the wrong file, or errors (observed as HTTP 400) if it now points past the end.

Unlike download, delete is SYNCHRONOUS end-to-end: the controller awaits RefreshMetadata, so the next GET /Items/{id} already reflects the new stream list (verified: correct at t+0s).

external subtitle, has no index, or the server URL is not set

Parameters:
NameTypeDescription
itemIdstring

The video item ID

streamdynamic

The subtitle MediaStream AA to delete; must be IsExternal

Returns:

Request AA: { method, url }, or invalid if the stream is not an

Type: 
dynamic

BuildDownloadRemoteSubtitleRequest(itemId, subtitleId) → {dynamic}

Build a request AA to have the SERVER download a remote subtitle onto the item, for use with fetchRes() (not SubmitSideEffect: see below).

The response carries NO success information: the controller wraps the download in try/catch, logs any failure, and returns 204 either way, then queues the metadata refresh ASYNCHRONOUSLY (QueueRefresh). A missing provider, absent credentials, and an exhausted daily quota all yield the same 204 as a success. The only honest completion signal is re-fetching the item and diffing its subtitle MediaStreams: see newSubtitleStreams().

Parameters:
NameTypeDescription
itemIdstring

The Movie or Episode ID

subtitleIdstring

RemoteSubtitleInfo.Id from a search result

Returns:

Request AA: { method, url } or invalid if server URL not set

Type: 
dynamic

BuildGetAdditionalPartsRequest(itemId) → {dynamic}

Build a request AA for GetAdditionalParts, for use with fetchRes() or fetchJson().

Parameters:
NameTypeDescription
itemIdstring

The video item ID

Returns:

Request AA: { method, url } or invalid if server URL not set

Type: 
dynamic

BuildGetAlbumArtistsRequest(paramsopt) → {dynamic}

Build a request AA to fetch all album artists, for use with fetchRes() or fetchJson(). Mirrors GetAlbumArtists(): applies injectDefaults and injects UserId.

Parameters:
NameTypeAttributesDefaultDescription
paramsobject<optional>
{}

Query parameters

Returns:

Request AA: { method, url } or invalid if no userId

Type: 
dynamic

BuildGetArtistSimilarRequest(itemId, paramsopt) → {dynamic}

Build a request AA to get similar artists, for use with fetchRes() or fetchJson().

Parameters:
NameTypeAttributesDefaultDescription
itemIdstring

The artist item ID

paramsobject<optional>
{}

Optional query parameters (userId, limit, etc.)

Returns:

Request AA: { method, url } or invalid if server URL not set

Type: 
dynamic

BuildGetArtistsRequest(paramsopt) → {dynamic}

Build a request AA to fetch all artists, for use with fetchRes() or fetchJson(). Mirrors GetArtists(): applies injectDefaults and injects UserId.

Parameters:
NameTypeAttributesDefaultDescription
paramsobject<optional>
{}

Query parameters

Returns:

Request AA: { method, url } or invalid if no userId

Type: 
dynamic

BuildGetBrandingConfigurationRequest() → {dynamic}

Build a request AA for GetBrandingConfiguration, for use with fetchRes() or fetchJson().

Returns:

Request AA: { method, url } or invalid if server URL not set

Type: 
dynamic

BuildGetCulturesRequest() → {dynamic}

Build a request AA for the server's culture list, for use with fetchRes() or fetchJson(). Returns an array of CultureDto.

Worth caching for the session: it is static per server (192 entries on 10.11.11) and is only needed to populate a language picker.

Returns:

Request AA: { method, url } or invalid if server URL not set

Type: 
dynamic

BuildGetEpisodesRequest(seriesId, paramsopt) → {dynamic}

Build a request AA for GetEpisodes, for use with fetchRes() or fetchJson().

Parameters:
NameTypeAttributesDefaultDescription
seriesIdstring

The series ID

paramsobject<optional>
{}

Optional query parameters (StartItemId, Limit, etc.)

Returns:

Request AA: { method, url } or invalid if no user

Type: 
dynamic

BuildGetFilters2Request(paramsopt) → {dynamic}

Build a request AA for GetFilters2, for use with fetchRes() or fetchJson().

A SECOND filters endpoint, not a replacement: the two return disjoint sets. /items/filters carries OfficialRatings and Years, which this one does not; this one carries AudioLanguages and SubtitleLanguages (12.0+), which that one does not. A caller wanting both has to ask twice, verified against the 10.11.11 and 12.0.0 OpenAPI specs, where QueryFiltersLegacy and QueryFilters are separate schemas.

On servers below 12.0 the response omits the language keys entirely, so their absence is a usable capability probe rather than an empty-list ambiguity.

Parameters:
NameTypeAttributesDefaultDescription
paramsobject<optional>
{}

Query parameters (userid, parentid, includeitemtypes, etc.)

Returns:

Request AA: { method, url } or invalid if server URL not set

Type: 
dynamic

BuildGetFiltersRequest(paramsopt) → {dynamic}

Build a request AA for GetFilters, for use with fetchRes() or fetchJson().

Parameters:
NameTypeAttributesDefaultDescription
paramsobject<optional>
{}

Query parameters (userid, parentid, includeitemtypes, etc.)

Returns:

Request AA: { method, url } or invalid if server URL not set

Type: 
dynamic

BuildGetGenresRequest(paramsopt) → {dynamic}

Build a request AA to fetch genres, for use with fetchRes() or fetchJson().

Parameters:
NameTypeAttributesDefaultDescription
paramsobject<optional>
{}

Query parameters

Returns:

Request AA: { method, url } or invalid if server URL not set

Type: 
dynamic

BuildGetInstantMixRequest(itemId, paramsopt) → {dynamic}

Build a request AA for GetInstantMix, for use with fetchJson().

Parameters:
NameTypeAttributesDefaultDescription
itemIdstring

The item ID

paramsobject<optional>
{}

Optional query parameters (Limit, etc.)

Returns:

Request AA: { method, url } or invalid if no user

Type: 
dynamic

BuildGetIntrosRequest(itemId) → {dynamic}

Build a request AA for GetIntros, for use with fetchJson().

Parameters:
NameTypeDescription
itemIdstring

The item ID

Returns:

Request AA: { method, url } or invalid if no user

Type: 
dynamic

BuildGetItemCollectionsRequest(itemId, paramsopt) → {dynamic}

Build a request AA for the collections an item belongs to, for use with fetchRes(). Jellyfin 12.0+ only, so there is no V1 path: older servers answer 404. Decide with extrasRows.supportsItemCollections() before building it.

Parameters:
NameTypeAttributesDefaultDescription
itemIdstring

The item ID

paramsobject<optional>
{}

Optional query parameters (userId, Fields, limit, startIndex)

Returns:

Request AA: { method, url } or invalid if server URL not set

Type: 
dynamic

BuildGetItemImageInfosRequest(itemId) → {dynamic}

Build a request AA for GetItemImageInfos: every image the item has, with each one's original Width and Height. The same path on every supported server (10.7.0 onward).

Parameters:
NameTypeDescription
itemIdstring

The item ID

Returns:

Request AA: { method, url, expect } or invalid

Type: 
dynamic

BuildGetItemLyricsRequest(itemId) → {dynamic}

Build a request AA for GetItemLyrics, for use with fetchJson().

Parameters:
NameTypeDescription
itemIdstring

The Audio item ID

Returns:

Request AA: { method, url } or invalid if server URL not set

Type: 
dynamic

BuildGetItemRawRequest(itemId, paramsopt) → {dynamic}

Build a request AA to get a single item WITHOUT image/version field injection.

Parameters:
NameTypeAttributesDefaultDescription
itemIdstring

The item ID

paramsobject<optional>
{}

Optional query parameters (passed through as-is)

Returns:

Request AA: { method, url } or invalid if no user

Type: 
dynamic

BuildGetItemRequest(itemId, paramsopt) → {dynamic}

Get a single item by ID with automatic image and version field injection Build a request AA to get a single item with automatic image/version field injection.

Parameters:
NameTypeAttributesDefaultDescription
itemIdstring

The item ID

paramsobject<optional>
{}

Optional query parameters (fields, etc.)

Returns:

Request AA: { method, url } or invalid if no user

Type: 
dynamic

BuildGetItemUserDataRequest(itemId) → {dynamic}

Build a request AA for one item's UserData (position, played, favorite), for use with fetchRes() or fetchAsync(). Returns a UserItemDataDto, about 150 bytes, where the full item is kilobytes.

It reads the play state of an ALTERNATE VERSION, which no item query returns on Jellyfin 12.0 (/Items?ids= filters versions out). Only per-version servers need that, so callers gate on versionResume.isPerVersionServer(). The route is not in the 10.7.0 floor spec, so a V1 server gets no request rather than a guessed path.

Parameters:
NameTypeDescription
itemIdstring

The item (or alternate version) ID

Returns:

Request AA: { method, url } or invalid if no user or a V1 server

Type: 
dynamic

BuildGetItemsByQueryRequest(paramsopt) → {dynamic}

Build a request AA for GetItemsByQuery, for use with fetchRes() or fetchJson().

Parameters:
NameTypeAttributesDefaultDescription
paramsobject<optional>
{}

Query parameters (limit, sortBy, filters, etc.)

Returns:

Request AA: { method, url } or invalid if no user

Type: 
dynamic

BuildGetLatestMediaRequest(paramsopt) → {dynamic}

Build a request AA for GetLatestMedia, for use with fetchRes() or fetchJson(). Both V1 and V2 return a bare array of BaseItemDto (not paginated). V1: /users/{id}/items/latest (10.7.x–10.8.x) V2: /Items/Latest?userId= (10.9+)

Parameters:
NameTypeAttributesDefaultDescription
paramsobject<optional>
{}

Optional query parameters (ParentId, Limit, etc.)

Returns:

Request AA: { method, url } or invalid if no userId

Type: 
dynamic

BuildGetLibraryOptionsInfoRequest() → {dynamic}

Build a request AA for the server's library options, for use with fetchRes() or fetchJson(). Returns a LibraryOptionsResultDto.

Used to learn which metadata PLUGINS the server has installed (SubtitleFetchers lists every installed subtitle provider by name), so a feature that needs one can be hidden rather than offered and then fail empty. Read by source/utils/serverCapabilities.bs.

Unchanged from 10.7.0 through 12.0, and authorized for ANY signed-in user (Policies.FirstTimeSetupOrDefault), so it needs no V1/V2 branch and no admin. libraryContentType is omitted on purpose: the server then reports plugins for Series, Season, Episode and Movie, exactly the types subtitle search supports.

Returns:

Request AA: { method, url } or invalid if server URL not set

Type: 
dynamic

BuildGetLiveTVChannelsRequest(paramsopt) → {dynamic}

Build a request AA to fetch Live TV channels, for use with fetchRes() or fetchJson().

Parameters:
NameTypeAttributesDefaultDescription
paramsobject<optional>
{}

Query parameters

Returns:

Request AA: { method, url } or invalid if server URL not set

Type: 
dynamic

BuildGetLiveTVProgramsRequest(paramsopt) → {dynamic}

Build a request AA for GetLiveTVPrograms (full EPG search), for use with fetchRes() or fetchJson(). Mirrors GetLiveTVPrograms(): applies injectDefaults.

Parameters:
NameTypeAttributesDefaultDescription
paramsobject<optional>
{}

Query parameters (SearchTerm, Limit, etc.)

Returns:

Request AA: { method, url } or invalid if server URL not set

Type: 
dynamic

BuildGetLiveTvProgramRequest(programId, paramsopt) → {dynamic}

Build a request AA to fetch a single Live TV program, for use with fetchRes() or fetchJson().

Parameters:
NameTypeAttributesDefaultDescription
programIdstring

The program ID

paramsobject<optional>
{}

Optional query parameters (UserId, etc.)

Returns:

Request AA: { method, url } or invalid if server URL not set

Type: 
dynamic

BuildGetLiveTvRecommendedProgramsRequest(paramsopt) → {dynamic}

Build a request AA to get recommended Live TV programs (On Now), for use with fetchRes() or fetchJson().

Parameters:
NameTypeAttributesDefaultDescription
paramsobject<optional>
{}

Query parameters (userId, isAiring, limit, etc.)

Returns:

Request AA: { method, url } or invalid if server URL not set

Type: 
dynamic

BuildGetLiveTvRecordingsRequest(paramsopt) → {dynamic}

Build a request AA to get Live TV recordings, for use with fetchRes() or fetchJson().

Parameters:
NameTypeAttributesDefaultDescription
paramsobject<optional>
{}

Query parameters (isInProgress, limit, status, etc.)

Returns:

Request AA: { method, url } or invalid if server URL not set

Type: 
dynamic

BuildGetLiveTvScheduleRequest(params) → {dynamic}

Build a request AA to fetch the Live TV schedule, for use with fetchRes() or fetchJson(). Uses POST because the channelIds list can exceed URL length limits.

Parameters:
NameTypeDescription
paramsobject

Query/body parameters (channelIds, startTime, endTime, UserId, etc.)

Returns:

Request AA: { method, url, body, headers } or invalid if server URL not set

Type: 
dynamic

BuildGetLiveTvTimerDefaultsRequest(programId) → {dynamic}

Build a request AA to fetch Live TV timer defaults for a program, for use with fetchRes() or fetchJson().

Parameters:
NameTypeDescription
programIdstring

The program ID to pre-fill timer defaults

Returns:

Request AA: { method, url } or invalid if server URL not set

Type: 
dynamic

BuildGetLocalTrailersRequest(itemId) → {dynamic}

Build a request AA for GetLocalTrailers, for use with submitApiRequest() or fetchJson(). Version-aware: V2 uses /Items/{id}/LocalTrailers, V1 uses /users/{userId}/items/{id}/localtrailers.

Parameters:
NameTypeDescription
itemIdstring

The item ID

Returns:

Request AA: { method, url } or invalid if no userId (V1 only)

Type: 
dynamic

BuildGetMediaSegmentsRequest(itemId, includeSegmentTypesopt) → {dynamic}

Build a request AA for GetMediaSegments, for use with fetchJson(). Only available on Jellyfin 10.10.0+ servers.

Parameters:
NameTypeAttributesDefaultDescription
itemIdstring

The item ID

includeSegmentTypesstring<optional>
""

Optional comma-separated segment types to filter (for example "Intro,Outro")

Returns:

Request AA: { method, url } or invalid if server URL not set

Type: 
dynamic

BuildGetNextUpRequest(paramsopt) → {dynamic}

Build a request AA for GetNextUp, for use with fetchRes() or fetchJson(). Mirrors GetNextUp(): applies injectDefaults and injects UserId.

Parameters:
NameTypeAttributesDefaultDescription
paramsobject<optional>
{}

Query parameters (SeriesId, limit, EnableRewatching, etc.)

Returns:

Request AA: { method, url } or invalid if no userId

Type: 
dynamic

BuildGetPersonsRequest(paramsopt) → {dynamic}

Build a request AA for GetPersons, for use with fetchRes() or fetchJson(). Applies injectDefaults and injects UserId.

Leaves out the Artist and AlbumArtist kinds unless the caller passes its own ExcludePersonTypes. From 12.0 the server lists music artists as people (jellyfin#16721), and the app lists artists from /Artists, so search showed a musician twice. jellyfin-web sends the same filter, marked to go once artists move to /Persons; drop it here then. Every supported server accepts the parameter, so it is not version-gated.

Parameters:
NameTypeAttributesDefaultDescription
paramsobject<optional>
{}

Query parameters (for example IsFavorite, searchTerm)

Returns:

Request AA: { method, url } or invalid if no userId

Type: 
dynamic

BuildGetPlaylistItemsRequest(playlistId, paramsopt) → {dynamic}

Build a request AA for GetPlaylistItems, for use with fetchRes() or fetchJson().

Parameters:
NameTypeAttributesDefaultDescription
playlistIdstring

The playlist ID

paramsobject<optional>
{}

Optional query parameters

Returns:

Request AA: { method, url } or invalid if no user

Type: 
dynamic

BuildGetQuickConnectEnabledRequest() → {dynamic}

Build a request AA for GetQuickConnectEnabled, for use with fetchRes() or fetchJson(). Server responds with a plain boolean body (true = enabled, false = disabled). Lowercase path matches the existing /quickconnect/initiate convention - Jellyfin's routing is case-insensitive but reverse proxies in the wild sometimes are not.

Returns:

Request AA: { method, url } or invalid if server URL not set

Type: 
dynamic

BuildGetResumeItemsRequest(paramsopt) → {dynamic}

Build a request AA for GetResumeItems (Continue Watching), for use with fetchRes() or fetchJson(). Mirrors GetResumeItems(): applies injectDefaults, version-aware endpoint.

The server hardcodes Recursive, OrderBy=DatePlayed and IsResumable on this endpoint, so MediaTypes is the only narrowing a client controls. Don't bother sending recursive / SortBy / SortOrder / Filters, they are ignored. Since 12.0 a folder also matches IsResumable when a descendant is in progress, so an unfiltered query returns Seasons and Series (by design) mixed in with the episodes. Every JellyRock resume flow is video, so default to Video; pass MediaTypes as a comma-separated STRING to widen it.

Parameters:
NameTypeAttributesDefaultDescription
paramsobject<optional>
{}

Optional query parameters

Returns:

Request AA: { method, url } or invalid if no userId

Type: 
dynamic

BuildGetSeasonsRequest(seriesId, paramsopt) → {dynamic}

Build a request AA for GetSeasons, for use with fetchRes() or fetchJson(). Mirrors GetSeasons(): applies injectDefaults and injects UserId.

Parameters:
NameTypeAttributesDefaultDescription
seriesIdstring

The series ID

paramsobject<optional>
{}

Optional query parameters

Returns:

Request AA: { method, url } or invalid if no userId

Type: 
dynamic

BuildGetServerConfigurationRequest() → {dynamic}

Build a request AA for the server configuration, for use with fetchRes() or fetchAsync(). Returns a ServerConfiguration.

Read for MaxResumePct: the percentage past which the server records playback as finished instead of storing a resume position (source/utils/versionResume.bs). Authorized for ANY signed-in user, not only admins: a non-admin account got 200 on 10.7.7, 10.10.7, 10.11.11 and 12.0.0.

Returns:

Request AA: { method, url } or invalid if server URL not set

Type: 
dynamic

BuildGetSessionsRequest(paramsopt) → {dynamic}

Build a request AA to get active sessions, for use with fetchJson().

Parameters:
NameTypeAttributesDefaultDescription
paramsobject<optional>
{}

Query parameters (for example { deviceId: "..." })

Returns:

Request AA: { method, url } or invalid if server URL not set

Type: 
dynamic

BuildGetSimilarItemsRequest(itemId, paramsopt) → {dynamic}

Build a request AA to get similar items, for use with fetchRes() or fetchJson().

Parameters:
NameTypeAttributesDefaultDescription
itemIdstring

The item ID

paramsobject<optional>
{}

Optional query parameters (userId, limit, etc.)

Returns:

Request AA: { method, url } or invalid if server URL not set

Type: 
dynamic

BuildGetSpecialFeaturesRequest(itemId) → {dynamic}

Build a request AA for GetSpecialFeatures, for use with fetchRes() or fetchJson(). Mirrors GetSpecialFeatures(): version-aware endpoint.

Parameters:
NameTypeDescription
itemIdstring

The item ID

Returns:

Request AA: { method, url } or invalid if no userId (V1 only)

Type: 
dynamic

BuildGetStudiosRequest(paramsopt) → {dynamic}

Build a request AA to fetch studios, for use with fetchRes() or fetchJson().

Parameters:
NameTypeAttributesDefaultDescription
paramsobject<optional>
{}

Query parameters

Returns:

Request AA: { method, url } or invalid if server URL not set

Type: 
dynamic

BuildGetViewsRequest() → {dynamic}

Build a request AA for GetViews, for use with fetchRes() or fetchJson(). Mirrors GetViews(): version-aware endpoint.

Returns:

Request AA: { method, url } or invalid if no userId

Type: 
dynamic

BuildHeadItemImageRequest(id, imageType, imageIndexopt) → {dynamic}

Build a HEAD request AA to check if an item image exists, for use with fetchRes() or fetchJson(). Caller checks res.ok: no body is returned for HEAD requests.

Parameters:
NameTypeAttributesDefaultDescription
idstring

Item ID

imageTypestring

Type of image (for example "logo", "Primary")

imageIndexinteger<optional>
0

Image index (default 0)

Returns:

Request AA: { method, url } or invalid if server URL not set

Type: 
dynamic

BuildInitiateQuickConnectRequest() → {dynamic}

Build a request AA to start a Quick Connect request, for use with fetchAsync() / fetchRes(). The response carries the Secret we poll with and the Code the user types on their other device.

The HTTP METHOD moved at the same boundary as the apiVersion split: apiVersion 1 (10.7.0 - 10.8.13): GET (no POST route exists) apiVersion 2 (10.9.0+): POST (no GET route exists) Confirmed against every published spec from 10.7.0 to 10.11.8: each version declares exactly one of the two verbs, and the swap is at exactly 10.9.0.

Sending the wrong method to a modern server yields 401 ("Quick connect is not active on this server"), which reads as a feature gate but is actually a route mismatch, so the dispatch matters; it is not cosmetic. That collision is also why quickConnectInitiateFailure treats 401 as "disabled": it is the same code either way, and a route mismatch is our bug, not something to tell a user.

Returns:

Request AA: { method, url } or invalid if server URL not set

Type: 
dynamic

BuildMarkFavoriteRequest(itemId) → {dynamic}

Build a request AA to mark an item as favorite, for use with SubmitSideEffect().

Parameters:
NameTypeDescription
itemIdstring

The item ID

Returns:

Request AA: { method, url } or invalid if no user

Type: 
dynamic

BuildMarkPlayedRequest(itemId) → {dynamic}

Build a request AA to mark an item as played, for use with SubmitSideEffect(). Includes default DatePlayed (now) and PlaybackPositionTicks (0) matching Jellyfin API expectations.

Parameters:
NameTypeDescription
itemIdstring

The item ID

Returns:

Request AA: { method, url } or invalid if no user

Type: 
dynamic

BuildPlaystateRequest(state, params) → {dynamic}

Build a playstate request AA for use with SubmitSideEffect(). Applies default playstate fields and routes to the correct session endpoint.

Parameters:
NameTypeDescription
statestring

"start" | "update" | "stop" | "finished"

paramsobject

Playback parameters (ItemId, PositionTicks, IsPaused, etc.)

Returns:

Request AA: { method, url, body, headers } or invalid if state unknown

Type: 
dynamic

BuildPostPlaybackInfoRequest(itemId, postData) → {dynamic}

Build a request AA for PostPlaybackInfo, for use with fetchJson().

Parameters:
NameTypeDescription
itemIdstring

The item ID

postDataobject

Request body data (DeviceProfile, MediaSourceId, etc.)

Returns:

Request AA: { method, url, body } or invalid if server URL not set

Type: 
dynamic

BuildPostSessionCapabilitiesRequest(capabilities) → {dynamic}

Build a request AA to post full session capabilities, for use with SubmitSideEffect().

Parameters:
NameTypeDescription
capabilitiesobject

Device capabilities AA from getDeviceCapabilities()

Returns:

Request AA: { method, url, body, headers } or invalid if server URL not set

Type: 
dynamic

BuildSearchRemoteSubtitlesRequest(itemId, language, isPerfectMatchopt) → {dynamic}

Build a request AA to search a server's configured subtitle providers, for use with fetchRes() or fetchJson(). Returns an array of RemoteSubtitleInfo.

language is passed straight through to the server, which resolves it via LocalizationManager.FindLanguageInfo(), which matches case-insensitively on DisplayName, Name, TwoLetterISOLanguageName, OR either ISO 639-2 variant (/T and /B both live in ThreeLetterISOLanguageNames). So "fra", "fre", "fr" and "French" are all accepted. Prefer the TWO-letter form from /Localization/Cultures: it is what reaches the provider, and it preserves regional variants that the 3-letter form collapses (zh-tw / zh-cn / zh-hk all share "zho"; es-419 shares "spa" with Castilian).

a true value returns only results whose IsHashMatch is set, which is frequently an empty list.

Parameters:
NameTypeAttributesDefaultDescription
itemIdstring

The Movie or Episode ID

languagestring

Language code (see above; 2-letter or regional preferred)

isPerfectMatchboolean<optional>
false

Restrict to file-hash matches only. Defaults false;

Returns:

Request AA: { method, url } or invalid if server URL not set

Type: 
dynamic

BuildUnmarkFavoriteRequest(itemId) → {dynamic}

Build a request AA to unmark an item as favorite, for use with SubmitSideEffect().

Parameters:
NameTypeDescription
itemIdstring

The item ID

Returns:

Request AA: { method, url } or invalid if no user

Type: 
dynamic

BuildUnmarkPlayedRequest(itemId) → {dynamic}

Build a request AA to mark an item as unplayed, for use with SubmitSideEffect().

Parameters:
NameTypeDescription
itemIdstring

The item ID

Returns:

Request AA: { method, url } or invalid if no user

Type: 
dynamic

GetDisplayPreferences(id, paramsopt) → {dynamic}

Get display preferences

Parameters:
NameTypeAttributesDefaultDescription
idstring

Preference ID

paramsobject<optional>
{}

Query parameters

Returns:

API response or invalid on error

Type: 
dynamic

GetImageURL(id, imageType, imageIndexopt, paramsopt) → {dynamic}

Get image URL

Parameters:
NameTypeAttributesDefaultDescription
idstring

Item ID

imageTypestring

Type of image

imageIndexinteger<optional>
0

Image index

paramsobject<optional>
{}

Optional parameters

Returns:

API response or invalid on error

Type: 
dynamic

GetPublicUsers() → {dynamic}

Get public users Synchronous, so it bypasses the pool's shape check (listReq); the list is read here instead.

Returns:

an roArray of UserDto, or invalid on error or a body that holds no list

Type: 
dynamic

GetUser(userId) → {dynamic}

Get user by ID

Parameters:
NameTypeDescription
userIdstring

The user ID

Returns:

API response or invalid on error

Type: 
dynamic

GetUserImageURL(id, imageType, imageIndexopt, paramsopt) → {dynamic}

Get user image URL

Parameters:
NameTypeAttributesDefaultDescription
idstring

User ID

imageTypestring

Type of image

imageIndexinteger<optional>
0

Image index

paramsobject<optional>
{}

Optional parameters

Returns:

API response or invalid on error

Type: 
dynamic