@timmo001/effect-upnext-shared
v2.1.1
Published
Effect schemas shared by upnext's media sources and clients
Readme
@timmo001/effect-upnext-shared
Effect schemas shared by Up Next's media sources and clients.
Every source, such as Twitch or YouTube, maps what it finds to the same MediaItem, so apps can show one list without handling each platform separately.
Install
bun add @timmo001/effect-upnext-shared effect
npm install @timmo001/effect-upnext-shared effect
npx jsr add @timmo001/effect-upnext-sharedeffect is a peer dependency, so install the same Effect v4 version your app uses.
Schemas
Source:twitch,youtubeorlink. A link is any other URL saved to watch later.MediaKind:live,upcoming,uploadorsaved.MediaChannel: a channel'sid,nameandurl.MediaItem: one thing to watch. Itsidis prefixed with its source, such astwitch:<login>,youtube:<video ID>orlink:<UUID>. It has atitle,urland optionalchannel,thumbnailUrl,categoryandpublishedAt.
publishedAt is a DateTime.Utc. Use Schema.toCodecJson(MediaItem) to read or write items as JSON.
import { MediaItem } from "@timmo001/effect-upnext-shared";
import { Schema } from "effect";
const decode = Schema.decodeUnknownEffect(Schema.toCodecJson(MediaItem));Licence
Apache 2.0. See LICENSE.
