export type MediaPathInfo = {Path?: (string | null) | undefined, NetworkPath?: (string | null) | undefined}; export type ImageType = 'Primary' | 'Art' | 'Backdrop' | 'Banner' | 'Logo' | 'Thumb' | 'Disc' | 'Box' | 'Screenshot' | 'Menu' | 'Chapter' | 'BoxRear' | 'Profile'; export type ImageOption = {Type?: ImageType | undefined, Limit?: number | undefined, MinWidth?: number | undefined}; export type TypeOptions = {Type?: (string | null) | undefined, MetadataFetchers?: (Array | null) | undefined, MetadataFetcherOrder?: (Array | null) | undefined, ImageFetchers?: (Array | null) | undefined, ImageFetcherOrder?: (Array | null) | undefined, ImageOptions?: (Array | null) | undefined}; export type LibraryOptions = {EnablePhotos?: boolean | undefined, EnableRealtimeMonitor?: boolean | undefined, EnableChapterImageExtraction?: boolean | undefined, ExtractChapterImagesDuringLibraryScan?: boolean | undefined, PathInfos?: (Array | null) | undefined, SaveLocalMetadata?: boolean | undefined, EnableInternetProviders?: boolean | undefined, EnableAutomaticSeriesGrouping?: boolean | undefined, EnableEmbeddedTitles?: boolean | undefined, EnableEmbeddedEpisodeInfos?: boolean | undefined, AutomaticRefreshIntervalDays?: number | undefined, PreferredMetadataLanguage?: (string | null) | undefined, MetadataCountryCode?: (string | null) | undefined, SeasonZeroDisplayName?: (string | null) | undefined, MetadataSavers?: (Array | null) | undefined, DisabledLocalMetadataReaders?: (Array | null) | undefined, LocalMetadataReaderOrder?: (Array | null) | undefined, DisabledSubtitleFetchers?: (Array | null) | undefined, SubtitleFetcherOrder?: (Array | null) | undefined, SkipSubtitlesIfEmbeddedSubtitlesPresent?: boolean | undefined, SkipSubtitlesIfAudioTrackMatches?: boolean | undefined, SubtitleDownloadLanguages?: (Array | null) | undefined, RequirePerfectSubtitleMatch?: boolean | undefined, SaveSubtitlesWithMedia?: boolean | undefined, TypeOptions?: (Array | null) | undefined}; export type UpdateLibraryOptionsDto = {Id?: string | undefined, LibraryOptions?: LibraryOptions | undefined}; export type CreateApiLibraryVirtualFoldersLibraryOptionsArgs = {body: UpdateLibraryOptionsDto}; export type CreateApiLibraryVirtualFoldersLibraryOptionsOptions = {baseUrl?: string | undefined, CustomAuthentication?: string | undefined, fetch?: typeof fetch | undefined}; /** * Update library options. * * POST /Library/VirtualFolders/LibraryOptions */ export const createApiLibraryVirtualFoldersLibraryOptions = async (args: CreateApiLibraryVirtualFoldersLibraryOptionsArgs, options?: CreateApiLibraryVirtualFoldersLibraryOptionsOptions) => { const {baseUrl = "http://localhost", fetch: fetchFn = fetch, CustomAuthentication} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (CustomAuthentication !== undefined) headers.set("X-Emby-Authorization", CustomAuthentication) const url = `${baseUrl.replace(/\/+$/, '')}/Library/VirtualFolders/LibraryOptions${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };