From 84246e9dde3475b2a14c4550a1680d69c4dff73d Mon Sep 17 00:00:00 2001 From: Uruk Date: Sat, 23 May 2026 23:20:08 +0200 Subject: [PATCH] feat(casting): add cast autoplay countdown atom --- utils/atoms/castAutoplay.ts | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 utils/atoms/castAutoplay.ts diff --git a/utils/atoms/castAutoplay.ts b/utils/atoms/castAutoplay.ts new file mode 100644 index 000000000..b7313643e --- /dev/null +++ b/utils/atoms/castAutoplay.ts @@ -0,0 +1,17 @@ +/** + * Countdown state for Chromecast next-episode autoplay. The watcher + * (`useCastAutoplay`) writes it; the casting-player overlay reads it. + */ + +import type { BaseItemDto } from "@jellyfin/sdk/lib/generated-client/models"; +import { atom } from "jotai"; + +export interface CastAutoplayState { + /** The episode queued to play next. */ + nextEpisode: BaseItemDto; + /** Seconds left before it loads. */ + secondsRemaining: number; +} + +/** Active cast autoplay countdown, or null when none is running. */ +export const castAutoplayAtom = atom(null);