export type CreateApiLibraryMoviesUpdatedArgs = {tmdbId?: (string | null) | undefined, imdbId?: (string | null) | undefined}; export type CreateApiLibraryMoviesUpdatedOptions = {baseUrl?: string | undefined, CustomAuthentication?: string | undefined, fetch?: typeof fetch | undefined}; /** * Reports that new movies have been added by an external source. * * POST /Library/Movies/Updated */ export const createApiLibraryMoviesUpdated = async (args: CreateApiLibraryMoviesUpdatedArgs, options?: CreateApiLibraryMoviesUpdatedOptions) => { const {baseUrl = "http://localhost", fetch: fetchFn = fetch, CustomAuthentication} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.tmdbId != null) query.append("tmdbId", String(args.tmdbId)) if (args.imdbId != null) query.append("imdbId", String(args.imdbId)) if (CustomAuthentication !== undefined) headers.set("X-Emby-Authorization", CustomAuthentication) const url = `${baseUrl.replace(/\/+$/, '')}/Library/Movies/Updated${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };