mirror of
https://github.com/streamyfin/streamyfin.git
synced 2026-06-02 20:18:29 +01:00
feat(casting): add cast autoplay countdown atom
This commit is contained in:
17
utils/atoms/castAutoplay.ts
Normal file
17
utils/atoms/castAutoplay.ts
Normal file
@@ -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<CastAutoplayState | null>(null);
|
||||
Reference in New Issue
Block a user