/** * Autoplay API * * Functions to control autoplay in the backend. */ import { commands } from "$lib/api/bindings"; import type { PlayItemRequest, AutoplaySettings } from "$lib/api/bindings"; import { auth } from "$lib/stores/auth"; export type { AutoplaySettings }; export async function getAutoplaySettings(): Promise { return commands.playerGetAutoplaySettings(); } export async function setAutoplaySettings( settings: AutoplaySettings ): Promise { return commands.playerSetAutoplaySettings(auth.getUserId() ?? "", settings); } export async function cancelAutoplayCountdown(): Promise { await commands.playerCancelAutoplayCountdown(); } export async function playNextEpisode(item: PlayItemRequest): Promise { await commands.playerPlayNextEpisode(item); }