Tsarr Documentation - v2.16.0
    Preparing search index...

    Class JellyfinClient

    Jellyfin API client for media server management

    Closes the automation loop: trigger library scans after imports, read watched state back out, and check for active playback before running maintenance.

    Authenticates with an API key (Dashboard -> Advanced -> API Keys) using Jellyfin's MediaBrowser authorization scheme.

    const jellyfin = new JellyfinClient({
    baseUrl: 'http://localhost:8096',
    apiKey: 'your-api-key'
    });

    await jellyfin.refreshLibrary();
    const sessions = await jellyfin.getSessions();
    Index
    • Returns Promise<
          (
              | { data: SystemInfo; error: undefined }
              | { data: undefined; error: unknown }
          ) & { request?: Request; response?: Response },
      >

    • Returns Promise<
          (
              | { data: PublicSystemInfo; error: undefined }
              | { data: undefined; error: unknown }
          ) & { request?: Request; response?: Response },
      >

    • Returns Promise<
          (
              | { data: string; error: undefined }
              | { data: undefined; error: unknown }
          ) & { request?: Request; response?: Response },
      >

    • Parameters

      • Optionaloptions: {
            startIndex?: number;
            limit?: number;
            minDate?: string;
            maxDate?: string;
            hasUserId?: boolean;
            name?: string;
            overview?: string;
            shortOverview?: string;
            type?: string;
            itemId?: string;
            username?: string;
            severity?:
                | "Trace"
                | "Debug"
                | "Information"
                | "Warning"
                | "Error"
                | "Critical"
                | "None";
            sortBy?: ActivityLogSortBy[];
            sortOrder?: SortOrder[];
        }
        • OptionalstartIndex?: number

          The record index to start at. All items with a lower index will be dropped from the results.

        • Optionallimit?: number

          The maximum number of records to return.

        • OptionalminDate?: string

          The minimum date.

        • OptionalmaxDate?: string

          The maximum date.

        • OptionalhasUserId?: boolean

          Filter log entries if it has user id, or not.

        • Optionalname?: string

          Filter by name.

        • Optionaloverview?: string

          Filter by overview.

        • OptionalshortOverview?: string

          Filter by short overview.

        • Optionaltype?: string

          Filter by type.

        • OptionalitemId?: string

          Filter by item id.

        • Optionalusername?: string

          Filter by username.

        • Optionalseverity?: "Trace" | "Debug" | "Information" | "Warning" | "Error" | "Critical" | "None"

          Filter by log severity.

        • OptionalsortBy?: ActivityLogSortBy[]

          Specify one or more sort orders. Format: SortBy=Name,Type.

        • OptionalsortOrder?: SortOrder[]

          Sort Order..

      Returns Promise<
          (
              | { data: ActivityLogEntryQueryResult; error: undefined }
              | { data: undefined; error: unknown }
          ) & { request?: Request; response?: Response },
      >

    • Trigger a full library scan. Returns immediately; the scan runs in the background.

      Returns Promise<
          ({ data: void; error: undefined } | { data: undefined; error: unknown }) & {
              request?: Request;
              response?: Response;
          },
      >

    • Refresh metadata for a single item.

      Parameters

      • itemId: string
      • Optionaloptions: {
            metadataRefreshMode?:
                | "None"
                | "Default"
                | "ValidationOnly"
                | "FullRefresh";
            imageRefreshMode?: "None"
            | "Default"
            | "ValidationOnly"
            | "FullRefresh";
            replaceAllMetadata?: boolean;
            replaceAllImages?: boolean;
            regenerateTrickplay?: boolean;
        }
        • OptionalmetadataRefreshMode?: "None" | "Default" | "ValidationOnly" | "FullRefresh"

          (Optional) Specifies the metadata refresh mode.

        • OptionalimageRefreshMode?: "None" | "Default" | "ValidationOnly" | "FullRefresh"

          (Optional) Specifies the image refresh mode.

        • OptionalreplaceAllMetadata?: boolean

          (Optional) Determines if metadata should be replaced. Only applicable if mode is FullRefresh.

        • OptionalreplaceAllImages?: boolean

          (Optional) Determines if images should be replaced. Only applicable if mode is FullRefresh.

        • OptionalregenerateTrickplay?: boolean

          (Optional) Determines if trickplay images should be replaced. Only applicable if mode is FullRefresh.

      Returns Promise<
          ({ data: void; error: undefined } | { data: undefined; error: unknown }) & {
              request?: Request;
              response?: Response;
          },
      >

    • Returns Promise<
          (
              | { data: VirtualFolderInfo[]; error: undefined }
              | { data: undefined; error: unknown }
          ) & { request?: Request; response?: Response },
      >

    • Parameters

      • name: string
      • Optionaloptions: { collectionType?: CollectionType; paths?: string[]; refreshLibrary?: boolean }

      Returns Promise<
          ({ data: void; error: undefined } | { data: undefined; error: unknown }) & {
              request?: Request;
              response?: Response;
          },
      >

    • Parameters

      • name: string
      • OptionalrefreshLibrary: boolean

      Returns Promise<
          ({ data: void; error: undefined } | { data: undefined; error: unknown }) & {
              request?: Request;
              response?: Response;
          },
      >

    • Returns Promise<
          (
              | { data: BaseItemDtoQueryResult; error: undefined }
              | { data: undefined; error: unknown }
          ) & { request?: Request; response?: Response },
      >

    • Parameters

      • Optionaloptions: {
            userId?: string;
            maxOfficialRating?: string;
            hasThemeSong?: boolean;
            hasThemeVideo?: boolean;
            hasSubtitles?: boolean;
            hasSpecialFeature?: boolean;
            hasTrailer?: boolean;
            adjacentTo?: string;
            indexNumber?: number;
            parentIndexNumber?: number;
            hasParentalRating?: boolean;
            isHd?: boolean;
            is4K?: boolean;
            locationTypes?: LocationType[];
            excludeLocationTypes?: LocationType[];
            isMissing?: boolean;
            isUnaired?: boolean;
            minCommunityRating?: number;
            minCriticRating?: number;
            minPremiereDate?: string;
            minDateLastSaved?: string;
            minDateLastSavedForUser?: string;
            maxPremiereDate?: string;
            hasOverview?: boolean;
            hasImdbId?: boolean;
            hasTmdbId?: boolean;
            hasTvdbId?: boolean;
            isMovie?: boolean;
            isSeries?: boolean;
            isNews?: boolean;
            isKids?: boolean;
            isSports?: boolean;
            excludeItemIds?: string[];
            startIndex?: number;
            limit?: number;
            recursive?: boolean;
            searchTerm?: string;
            sortOrder?: SortOrder[];
            parentId?: string;
            fields?: ItemFields[];
            excludeItemTypes?: BaseItemKind[];
            includeItemTypes?: BaseItemKind[];
            filters?: ItemFilter[];
            isFavorite?: boolean;
            mediaTypes?: MediaType[];
            imageTypes?: ImageType[];
            sortBy?: ItemSortBy[];
            isPlayed?: boolean;
            genres?: string[];
            officialRatings?: string[];
            tags?: string[];
            years?: number[];
            enableUserData?: boolean;
            imageTypeLimit?: number;
            enableImageTypes?: ImageType[];
            person?: string;
            personIds?: string[];
            personTypes?: string[];
            studios?: string[];
            artists?: string[];
            excludeArtistIds?: string[];
            artistIds?: string[];
            albumArtistIds?: string[];
            contributingArtistIds?: string[];
            albums?: string[];
            albumIds?: string[];
            ids?: string[];
            videoTypes?: VideoType[];
            minOfficialRating?: string;
            isLocked?: boolean;
            isPlaceHolder?: boolean;
            hasOfficialRating?: boolean;
            collapseBoxSetItems?: boolean;
            minWidth?: number;
            minHeight?: number;
            maxWidth?: number;
            maxHeight?: number;
            is3D?: boolean;
            seriesStatus?: SeriesStatus[];
            nameStartsWithOrGreater?: string;
            nameStartsWith?: string;
            nameLessThan?: string;
            studioIds?: string[];
            genreIds?: string[];
            audioLanguages?: string[];
            subtitleLanguages?: string[];
            enableTotalRecordCount?: boolean;
            enableImages?: boolean;
        }
        • OptionaluserId?: string

          The user id supplied as query parameter; this is required when not using an API key.

        • OptionalmaxOfficialRating?: string

          Optional filter by maximum official rating (PG, PG-13, TV-MA, etc).

        • OptionalhasThemeSong?: boolean

          Optional filter by items with theme songs.

        • OptionalhasThemeVideo?: boolean

          Optional filter by items with theme videos.

        • OptionalhasSubtitles?: boolean

          Optional filter by items with subtitles.

        • OptionalhasSpecialFeature?: boolean

          Optional filter by items with special features.

        • OptionalhasTrailer?: boolean

          Optional filter by items with trailers.

        • OptionaladjacentTo?: string

          Optional. Return items that are siblings of a supplied item.

        • OptionalindexNumber?: number

          Optional filter by index number.

        • OptionalparentIndexNumber?: number

          Optional filter by parent index number.

        • OptionalhasParentalRating?: boolean

          Optional filter by items that have or do not have a parental rating.

        • OptionalisHd?: boolean

          Optional filter by items that are HD or not.

        • Optionalis4K?: boolean

          Optional filter by items that are 4K or not.

        • OptionallocationTypes?: LocationType[]

          Optional. If specified, results will be filtered based on LocationType. This allows multiple, comma delimited.

        • OptionalexcludeLocationTypes?: LocationType[]

          Optional. If specified, results will be filtered based on the LocationType. This allows multiple, comma delimited.

        • OptionalisMissing?: boolean

          Optional filter by items that are missing episodes or not.

        • OptionalisUnaired?: boolean

          Optional filter by items that are unaired episodes or not.

        • OptionalminCommunityRating?: number

          Optional filter by minimum community rating.

        • OptionalminCriticRating?: number

          Optional filter by minimum critic rating.

        • OptionalminPremiereDate?: string

          Optional. The minimum premiere date. Format = ISO.

        • OptionalminDateLastSaved?: string

          Optional. The minimum last saved date. Format = ISO.

        • OptionalminDateLastSavedForUser?: string

          Optional. The minimum last saved date for the current user. Format = ISO.

        • OptionalmaxPremiereDate?: string

          Optional. The maximum premiere date. Format = ISO.

        • OptionalhasOverview?: boolean

          Optional filter by items that have an overview or not.

        • OptionalhasImdbId?: boolean

          Optional filter by items that have an IMDb id or not.

        • OptionalhasTmdbId?: boolean

          Optional filter by items that have a TMDb id or not.

        • OptionalhasTvdbId?: boolean

          Optional filter by items that have a TVDb id or not.

        • OptionalisMovie?: boolean

          Optional filter for live tv movies.

        • OptionalisSeries?: boolean

          Optional filter for live tv series.

        • OptionalisNews?: boolean

          Optional filter for live tv news.

        • OptionalisKids?: boolean

          Optional filter for live tv kids.

        • OptionalisSports?: boolean

          Optional filter for live tv sports.

        • OptionalexcludeItemIds?: string[]

          Optional. If specified, results will be filtered by excluding item ids. This allows multiple, comma delimited.

        • OptionalstartIndex?: number

          Optional. The record index to start at. All items with a lower index will be dropped from the results.

        • Optionallimit?: number

          Optional. The maximum number of records to return.

        • Optionalrecursive?: boolean

          When searching within folders, this determines whether or not the search will be recursive. true/false.

        • OptionalsearchTerm?: string

          Optional. Filter based on a search term.

        • OptionalsortOrder?: SortOrder[]

          Sort Order - Ascending, Descending.

        • OptionalparentId?: string

          Specify this to localize the search to a specific item or folder. Omit to use the root.

        • Optionalfields?: ItemFields[]

          Optional. Specify additional fields of information to return in the output. This allows multiple, comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, SortName, Studios, Taglines.

        • OptionalexcludeItemTypes?: BaseItemKind[]

          Optional. If specified, results will be filtered based on item type. This allows multiple, comma delimited.

        • OptionalincludeItemTypes?: BaseItemKind[]

          Optional. If specified, results will be filtered based on the item type. This allows multiple, comma delimited.

        • Optionalfilters?: ItemFilter[]

          Optional. Specify additional filters to apply. This allows multiple, comma delimited. Options: IsFolder, IsNotFolder, IsUnplayed, IsPlayed, IsFavorite, IsResumable, Likes, Dislikes.

        • OptionalisFavorite?: boolean

          Optional filter by items that are marked as favorite, or not.

        • OptionalmediaTypes?: MediaType[]

          Optional filter by MediaType. Allows multiple, comma delimited.

        • OptionalimageTypes?: ImageType[]

          Optional. If specified, results will be filtered based on those containing image types. This allows multiple, comma delimited.

        • OptionalsortBy?: ItemSortBy[]

          Optional. Specify one or more sort orders, comma delimited. Options: Album, AlbumArtist, Artist, Budget, CommunityRating, CriticRating, DateCreated, DatePlayed, PlayCount, PremiereDate, ProductionYear, SortName, Random, Revenue, Runtime.

        • OptionalisPlayed?: boolean

          Optional filter by items that are played, or not.

        • Optionalgenres?: string[]

          Optional. If specified, results will be filtered based on genre. This allows multiple, pipe delimited.

        • OptionalofficialRatings?: string[]

          Optional. If specified, results will be filtered based on OfficialRating. This allows multiple, pipe delimited.

        • Optionaltags?: string[]

          Optional. If specified, results will be filtered based on tag. This allows multiple, pipe delimited.

        • Optionalyears?: number[]

          Optional. If specified, results will be filtered based on production year. This allows multiple, comma delimited.

        • OptionalenableUserData?: boolean

          Optional, include user data.

        • OptionalimageTypeLimit?: number

          Optional, the max number of images to return, per image type.

        • OptionalenableImageTypes?: ImageType[]

          Optional. The image types to include in the output.

        • Optionalperson?: string

          Optional. If specified, results will be filtered to include only those containing the specified person.

        • OptionalpersonIds?: string[]

          Optional. If specified, results will be filtered to include only those containing the specified person id.

        • OptionalpersonTypes?: string[]

          Optional. If specified, along with Person, results will be filtered to include only those containing the specified person and PersonType. Allows multiple, comma-delimited.

        • Optionalstudios?: string[]

          Optional. If specified, results will be filtered based on studio. This allows multiple, pipe delimited.

        • Optionalartists?: string[]

          Optional. If specified, results will be filtered based on artists. This allows multiple, pipe delimited.

        • OptionalexcludeArtistIds?: string[]

          Optional. If specified, results will be filtered based on artist id. This allows multiple, pipe delimited.

        • OptionalartistIds?: string[]

          Optional. If specified, results will be filtered to include only those containing the specified artist id.

        • OptionalalbumArtistIds?: string[]

          Optional. If specified, results will be filtered to include only those containing the specified album artist id.

        • OptionalcontributingArtistIds?: string[]

          Optional. If specified, results will be filtered to include only those containing the specified contributing artist id.

        • Optionalalbums?: string[]

          Optional. If specified, results will be filtered based on album. This allows multiple, pipe delimited.

        • OptionalalbumIds?: string[]

          Optional. If specified, results will be filtered based on album id. This allows multiple, pipe delimited.

        • Optionalids?: string[]

          Optional. If specific items are needed, specify a list of item id's to retrieve. This allows multiple, comma delimited.

        • OptionalvideoTypes?: VideoType[]

          Optional filter by VideoType (videofile, dvd, bluray, iso). Allows multiple, comma delimited.

        • OptionalminOfficialRating?: string

          Optional filter by minimum official rating (PG, PG-13, TV-MA, etc).

        • OptionalisLocked?: boolean

          Optional filter by items that are locked.

        • OptionalisPlaceHolder?: boolean

          Optional filter by items that are placeholders.

        • OptionalhasOfficialRating?: boolean

          Optional filter by items that have official ratings.

        • OptionalcollapseBoxSetItems?: boolean

          Whether or not to hide items behind their boxsets.

        • OptionalminWidth?: number

          Optional. Filter by the minimum width of the item.

        • OptionalminHeight?: number

          Optional. Filter by the minimum height of the item.

        • OptionalmaxWidth?: number

          Optional. Filter by the maximum width of the item.

        • OptionalmaxHeight?: number

          Optional. Filter by the maximum height of the item.

        • Optionalis3D?: boolean

          Optional filter by items that are 3D, or not.

        • OptionalseriesStatus?: SeriesStatus[]

          Optional filter by Series Status. Allows multiple, comma delimited.

        • OptionalnameStartsWithOrGreater?: string

          Optional filter by items whose name is sorted equally or greater than a given input string.

        • OptionalnameStartsWith?: string

          Optional filter by items whose name is sorted equally than a given input string.

        • OptionalnameLessThan?: string

          Optional filter by items whose name is equally or lesser than a given input string.

        • OptionalstudioIds?: string[]

          Optional. If specified, results will be filtered based on studio id. This allows multiple, pipe delimited.

        • OptionalgenreIds?: string[]

          Optional. If specified, results will be filtered based on genre id. This allows multiple, pipe delimited.

        • OptionalaudioLanguages?: string[]

          Optional. If specified, results will be filtered based on audio language. This allows multiple, comma delimited values.

        • OptionalsubtitleLanguages?: string[]

          Optional. If specified, results will be filtered based on subtitle language. This allows multiple, comma delimited values.

        • OptionalenableTotalRecordCount?: boolean

          Optional. Enable the total record count.

        • OptionalenableImages?: boolean

          Optional, include image information in output.

      Returns Promise<
          (
              | { data: BaseItemDtoQueryResult; error: undefined }
              | { data: undefined; error: unknown }
          ) & { request?: Request; response?: Response },
      >

    • Parameters

      • itemId: string
      • userId: string

      Returns Promise<
          (
              | { data: BaseItemDto; error: undefined }
              | { data: undefined; error: unknown }
          ) & { request?: Request; response?: Response },
      >

    • Parameters

      • itemId: string

      Returns Promise<
          ({ data: void; error: undefined } | { data: undefined; error: unknown }) & {
              request?: Request;
              response?: Response;
          },
      >

    • Parameters

      • OptionaluserId: string

      Returns Promise<
          (
              | { data: ItemCounts; error: undefined }
              | { data: undefined; error: unknown }
          ) & { request?: Request; response?: Response },
      >

    • Parameters

      • options: UserScoped<
            {
                userId?: string;
                parentId?: string;
                fields?: ItemFields[];
                includeItemTypes?: BaseItemKind[];
                isPlayed?: boolean;
                enableImages?: boolean;
                imageTypeLimit?: number;
                enableImageTypes?: ImageType[];
                enableUserData?: boolean;
                limit?: number;
                groupItems?: boolean;
            },
        >

      Returns Promise<
          (
              | { data: BaseItemDto[]; error: undefined }
              | { data: undefined; error: unknown }
          ) & { request?: Request; response?: Response },
      >

    • Parameters

      • options: UserScoped<
            {
                userId?: string;
                startIndex?: number;
                limit?: number;
                fields?: ItemFields[];
                seriesId?: string;
                parentId?: string;
                enableImages?: boolean;
                imageTypeLimit?: number;
                enableImageTypes?: ImageType[];
                enableUserData?: boolean;
                nextUpDateCutoff?: string;
                enableTotalRecordCount?: boolean;
                enableResumable?: boolean;
                enableRewatching?: boolean;
            },
        >

      Returns Promise<
          (
              | { data: BaseItemDtoQueryResult; error: undefined }
              | { data: undefined; error: unknown }
          ) & { request?: Request; response?: Response },
      >

    • Parameters

      • options: UserScoped<
            {
                userId?: string;
                startIndex?: number;
                limit?: number;
                searchTerm?: string;
                parentId?: string;
                fields?: ItemFields[];
                mediaTypes?: MediaType[];
                enableUserData?: boolean;
                imageTypeLimit?: number;
                enableImageTypes?: ImageType[];
                excludeItemTypes?: BaseItemKind[];
                includeItemTypes?: BaseItemKind[];
                enableTotalRecordCount?: boolean;
                enableImages?: boolean;
                excludeActiveSessions?: boolean;
            },
        >

      Returns Promise<
          (
              | { data: BaseItemDtoQueryResult; error: undefined }
              | { data: undefined; error: unknown }
          ) & { request?: Request; response?: Response },
      >

    • Parameters

      • searchTerm: string
      • Optionaloptions: Omit<
            {
                startIndex?: number;
                limit?: number;
                userId?: string;
                searchTerm: string;
                includeItemTypes?: BaseItemKind[];
                excludeItemTypes?: BaseItemKind[];
                mediaTypes?: MediaType[];
                parentId?: string;
                isMovie?: boolean;
                isSeries?: boolean;
                isNews?: boolean;
                isKids?: boolean;
                isSports?: boolean;
                includePeople?: boolean;
                includeMedia?: boolean;
                includeGenres?: boolean;
                includeStudios?: boolean;
                includeArtists?: boolean;
            },
            "searchTerm",
        >

      Returns Promise<
          (
              | { data: SearchHintResult; error: undefined }
              | { data: undefined; error: unknown }
          ) & { request?: Request; response?: Response },
      >

    • Parameters

      • itemId: string
      • userId: string

      Returns Promise<
          (
              | { data: UserItemDataDto; error: undefined }
              | { data: undefined; error: unknown }
          ) & { request?: Request; response?: Response },
      >

    • Parameters

      • itemId: string
      • userId: string

      Returns Promise<
          (
              | { data: UserItemDataDto; error: undefined }
              | { data: undefined; error: unknown }
          ) & { request?: Request; response?: Response },
      >

    • Parameters

      • itemId: string
      • userId: string

      Returns Promise<
          (
              | { data: UserItemDataDto; error: undefined }
              | { data: undefined; error: unknown }
          ) & { request?: Request; response?: Response },
      >

    • Parameters

      • itemId: string
      • userId: string

      Returns Promise<
          (
              | { data: UserItemDataDto; error: undefined }
              | { data: undefined; error: unknown }
          ) & { request?: Request; response?: Response },
      >

    • Parameters

      • itemId: string
      • userId: string

      Returns Promise<
          (
              | { data: UserItemDataDto; error: undefined }
              | { data: undefined; error: unknown }
          ) & { request?: Request; response?: Response },
      >

    • Parameters

      • Optionaloptions: {
            controllableByUserId?: string;
            deviceId?: string;
            activeWithinSeconds?: number;
        }
        • OptionalcontrollableByUserId?: string

          Filter by sessions that a given user is allowed to remote control.

        • OptionaldeviceId?: string

          Filter by device Id.

        • OptionalactiveWithinSeconds?: number

          Optional. Filter by sessions that were active in the last n seconds.

      Returns Promise<
          (
              | { data: SessionInfoDto[]; error: undefined }
              | { data: undefined; error: unknown }
          ) & { request?: Request; response?: Response },
      >

    • Returns Promise<
          (
              | { data: UserDto[]; error: undefined }
              | { data: undefined; error: unknown }
          ) & { request?: Request; response?: Response },
      >

    • Parameters

      • userId: string

      Returns Promise<
          (
              | { data: UserDto; error: undefined }
              | { data: undefined; error: unknown }
          ) & { request?: Request; response?: Response },
      >

    • Returns Promise<
          (
              | { data: UserDto; error: undefined }
              | { data: undefined; error: unknown }
          ) & { request?: Request; response?: Response },
      >

    • Returns Promise<
          (
              | { data: TaskInfo[]; error: undefined }
              | { data: undefined; error: unknown }
          ) & { request?: Request; response?: Response },
      >

    • Parameters

      • taskId: string

      Returns Promise<
          ({ data: void; error: undefined } | { data: undefined; error: unknown }) & {
              request?: Request;
              response?: Response;
          },
      >

    • Parameters

      • taskId: string

      Returns Promise<
          ({ data: void; error: undefined } | { data: undefined; error: unknown }) & {
              request?: Request;
              response?: Response;
          },
      >

    • Send a playstate command to a session — pause, resume, seek, skip.

      seekPositionTicks is in .NET ticks (10,000 per millisecond), which is what Jellyfin uses throughout its API.

      Parameters

      • sessionId: string
      • command:
            | "Unpause"
            | "Pause"
            | "Stop"
            | "Seek"
            | "NextTrack"
            | "PreviousTrack"
            | "Rewind"
            | "FastForward"
            | "PlayPause"
      • Optionaloptions: { seekPositionTicks?: number; controllingUserId?: string }

      Returns Promise<
          ({ data: void; error: undefined } | { data: undefined; error: unknown }) & {
              request?: Request;
              response?: Response;
          },
      >

    • Send a general command to a session — volume, navigation, subtitles.

      Parameters

      • sessionId: string
      • command:
            | "Play"
            | "MoveUp"
            | "MoveDown"
            | "MoveLeft"
            | "MoveRight"
            | "PageUp"
            | "PageDown"
            | "PreviousLetter"
            | "NextLetter"
            | "ToggleOsd"
            | "ToggleContextMenu"
            | "Select"
            | "Back"
            | "TakeScreenshot"
            | "SendKey"
            | "SendString"
            | "GoHome"
            | "GoToSettings"
            | "VolumeUp"
            | "VolumeDown"
            | "Mute"
            | "Unmute"
            | "ToggleMute"
            | "SetVolume"
            | "SetAudioStreamIndex"
            | "SetSubtitleStreamIndex"
            | "ToggleFullscreen"
            | "DisplayContent"
            | "GoToSearch"
            | "DisplayMessage"
            | "SetRepeatMode"
            | "ChannelUp"
            | "ChannelDown"
            | "Guide"
            | "ToggleStats"
            | "PlayMediaSource"
            | "PlayTrailers"
            | "SetShuffleQueue"
            | "PlayState"
            | "PlayNext"
            | "ToggleOsdMenu"
            | "SetMaxStreamingBitrate"
            | "SetPlaybackOrder"

      Returns Promise<
          ({ data: void; error: undefined } | { data: undefined; error: unknown }) & {
              request?: Request;
              response?: Response;
          },
      >

    • Send a system command to a session — GoHome, GoToSettings, TakeScreenshot.

      Parameters

      • sessionId: string
      • command:
            | "Play"
            | "MoveUp"
            | "MoveDown"
            | "MoveLeft"
            | "MoveRight"
            | "PageUp"
            | "PageDown"
            | "PreviousLetter"
            | "NextLetter"
            | "ToggleOsd"
            | "ToggleContextMenu"
            | "Select"
            | "Back"
            | "TakeScreenshot"
            | "SendKey"
            | "SendString"
            | "GoHome"
            | "GoToSettings"
            | "VolumeUp"
            | "VolumeDown"
            | "Mute"
            | "Unmute"
            | "ToggleMute"
            | "SetVolume"
            | "SetAudioStreamIndex"
            | "SetSubtitleStreamIndex"
            | "ToggleFullscreen"
            | "DisplayContent"
            | "GoToSearch"
            | "DisplayMessage"
            | "SetRepeatMode"
            | "ChannelUp"
            | "ChannelDown"
            | "Guide"
            | "ToggleStats"
            | "PlayMediaSource"
            | "PlayTrailers"
            | "SetShuffleQueue"
            | "PlayState"
            | "PlayNext"
            | "ToggleOsdMenu"
            | "SetMaxStreamingBitrate"
            | "SetPlaybackOrder"

      Returns Promise<
          ({ data: void; error: undefined } | { data: undefined; error: unknown }) & {
              request?: Request;
              response?: Response;
          },
      >

    • Display a message on a session's screen.

      Parameters

      • sessionId: string
      • text: string
      • Optionaloptions: { header?: string; timeoutMs?: number }

      Returns Promise<
          ({ data: void; error: undefined } | { data: undefined; error: unknown }) & {
              request?: Request;
              response?: Response;
          },
      >

    • Instruct a session to play items.

      Parameters

      • sessionId: string
      • playCommand: "PlayNext" | "PlayNow" | "PlayLast" | "PlayInstantMix" | "PlayShuffle"
      • itemIds: string[]
      • Optionaloptions: PlayOptions

      Returns Promise<
          ({ data: void; error: undefined } | { data: undefined; error: unknown }) & {
              request?: Request;
              response?: Response;
          },
      >

    • Instruct a session to display an item's detail page.

      Parameters

      • sessionId: string
      • itemId: string
      • itemName: string
      • itemType:
            | "Trailer"
            | "AggregateFolder"
            | "Audio"
            | "AudioBook"
            | "BasePluginFolder"
            | "Book"
            | "BoxSet"
            | "Channel"
            | "ChannelFolderItem"
            | "CollectionFolder"
            | "Episode"
            | "Folder"
            | "Genre"
            | "ManualPlaylistsFolder"
            | "Movie"
            | "LiveTvChannel"
            | "LiveTvProgram"
            | "MusicAlbum"
            | "MusicArtist"
            | "MusicGenre"
            | "MusicVideo"
            | "Person"
            | "Photo"
            | "PhotoAlbum"
            | "Playlist"
            | "PlaylistsFolder"
            | "Program"
            | "Recording"
            | "Season"
            | "Series"
            | "Studio"
            | "TvChannel"
            | "TvProgram"
            | "UserRootFolder"
            | "UserView"
            | "Video"
            | "Year"

      Returns Promise<
          ({ data: void; error: undefined } | { data: undefined; error: unknown }) & {
              request?: Request;
              response?: Response;
          },
      >

    • Parameters

      • sessionId: string
      • userId: string

      Returns Promise<
          ({ data: void; error: undefined } | { data: undefined; error: unknown }) & {
              request?: Request;
              response?: Response;
          },
      >

    • Parameters

      • sessionId: string
      • userId: string

      Returns Promise<
          ({ data: void; error: undefined } | { data: undefined; error: unknown }) & {
              request?: Request;
              response?: Response;
          },
      >

    • Parameters

      • name: string
      • options: { userId: string; ids?: string[]; mediaType?: PlaylistMediaType }

      Returns Promise<
          (
              | { data: PlaylistCreationResult; error: undefined }
              | { data: undefined; error: unknown }
          ) & { request?: Request; response?: Response },
      >

    • Parameters

      • playlistId: string
      • options: UserScoped<
            {
                userId?: string;
                startIndex?: number;
                limit?: number;
                fields?: ItemFields[];
                enableImages?: boolean;
                enableUserData?: boolean;
                imageTypeLimit?: number;
                enableImageTypes?: ImageType[];
            },
        >

      Returns Promise<
          (
              | { data: BaseItemDtoQueryResult; error: undefined }
              | { data: undefined; error: unknown }
          ) & { request?: Request; response?: Response },
      >

    • Parameters

      • playlistId: string
      • ids: string[]
      • options: UserScoped<Omit<{ ids?: string[]; position?: number; userId?: string }, "ids">>

      Returns Promise<
          ({ data: void; error: undefined } | { data: undefined; error: unknown }) & {
              request?: Request;
              response?: Response;
          },
      >

    • Remove entries from a playlist by entry ID. On 10.11.11 and 12.0 the entry ID equals the underlying item ID, but read it from getPlaylistItems (PlaylistItemId) rather than relying on that.

      Parameters

      • playlistId: string
      • entryIds: string[]

      Returns Promise<
          ({ data: void; error: undefined } | { data: undefined; error: unknown }) & {
              request?: Request;
              response?: Response;
          },
      >

    • Parameters

      • name: string
      • Optionaloptions: Omit<
            { name?: string; ids?: string[]; parentId?: string; isLocked?: boolean },
            "name",
        >

      Returns Promise<
          (
              | { data: CollectionCreationResult; error: undefined }
              | { data: undefined; error: unknown }
          ) & { request?: Request; response?: Response },
      >

    • Parameters

      • collectionId: string
      • ids: string[]

      Returns Promise<
          ({ data: void; error: undefined } | { data: undefined; error: unknown }) & {
              request?: Request;
              response?: Response;
          },
      >

    • Parameters

      • collectionId: string
      • ids: string[]

      Returns Promise<
          ({ data: void; error: undefined } | { data: undefined; error: unknown }) & {
              request?: Request;
              response?: Response;
          },
      >

    • Which images an item already has, with dimensions — use to spot missing or low-quality artwork.

      Parameters

      • itemId: string

      Returns Promise<
          (
              | { data: ImageInfo[]; error: undefined }
              | { data: undefined; error: unknown }
          ) & { request?: Request; response?: Response },
      >

    • Artwork candidates from metadata providers, with language and community rating so a caller can pick a good one.

      Note: 10.11 reports Width/Height per candidate but 12.0 does not, even though the OpenAPI schema still declares them. Code that ranks candidates by resolution must fall back to CommunityRating.

      Parameters

      • itemId: string
      • Optionaltype: ImageType
      • Optionaloptions: RemoteImagesQuery

      Returns Promise<
          (
              | { data: RemoteImageResult; error: undefined }
              | { data: undefined; error: unknown }
          ) & { request?: Request; response?: Response },
      >

    • Parameters

      • itemId: string

      Returns Promise<
          (
              | { data: ImageProviderInfo[]; error: undefined }
              | { data: undefined; error: unknown }
          ) & { request?: Request; response?: Response },
      >

    • Attach an image to an item from a URL, replacing any existing image of that type. The URL does not have to come from getRemoteImages — any reachable image URL works.

      Parameters

      • itemId: string
      • type: ImageType
      • OptionalimageUrl: string

      Returns Promise<
          ({ data: void; error: undefined } | { data: undefined; error: unknown }) & {
              request?: Request;
              response?: Response;
          },
      >

    • Parameters

      • itemId: string
      • imageType: ImageType
      • OptionalimageIndex: number

      Returns Promise<
          ({ data: void; error: undefined } | { data: undefined; error: unknown }) & {
              request?: Request;
              response?: Response;
          },
      >

    • Parameters

      Returns {
          baseUrl: string;
          apiKey: string;
          timeout?: number;
          retry?: RetryOptions;
          headers?: Record<string, string>;
      }

      • baseUrl: string
      • apiKey: string
      • Optionaltimeout?: number

        Request timeout in milliseconds (default: 30000)

      • Optionalretry?: RetryOptions

        Retry configuration for transient failures

      • Optionalheaders?: Record<string, string>