export type DeleteApiVideosActiveEncodingsArgs = {deviceId?: (string | null) | undefined, playSessionId?: (string | null) | undefined}; export type DeleteApiVideosActiveEncodingsOptions = {baseUrl?: string | undefined, CustomAuthentication?: string | undefined, fetch?: typeof fetch | undefined}; /** * Stops an active encoding. * * DELETE /Videos/ActiveEncodings */ export const deleteApiVideosActiveEncodings = async (args: DeleteApiVideosActiveEncodingsArgs, options?: DeleteApiVideosActiveEncodingsOptions) => { const {baseUrl = "http://localhost", fetch: fetchFn = fetch, CustomAuthentication} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.deviceId != null) query.append("deviceId", String(args.deviceId)) if (args.playSessionId != null) query.append("playSessionId", String(args.playSessionId)) if (CustomAuthentication !== undefined) headers.set("X-Emby-Authorization", CustomAuthentication) const url = `${baseUrl.replace(/\/+$/, '')}/Videos/ActiveEncodings${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "DELETE", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };