@@ -143,6 +165,15 @@
Latest Episodes
-{format(new Date(show.date), 'MMMM do, yyyy')} × @@ -96,11 +93,40 @@ {#if show.aiShowNote?.description}
{show.aiShowNote?.description}
{/if} +{/snippet} + +Transcript not available yet! We have the AI robots on the job, check back soon!
{/if} diff --git a/src/state/media_preference.ts b/src/state/media_preference.ts new file mode 100644 index 000000000..792011d03 --- /dev/null +++ b/src/state/media_preference.ts @@ -0,0 +1,29 @@ +import { get, writable } from 'svelte/store'; +import { get_youtube_id } from '$utilities/youtube'; +import type { MediaKind } from './media_timeline'; + +const STORAGE_KEY = 'media_preference'; + +function read_preference(): MediaKind { + if (typeof localStorage === 'undefined') return 'VIDEO'; + return localStorage.getItem(STORAGE_KEY) === 'AUDIO' ? 'AUDIO' : 'VIDEO'; +} + +// Whether episodes with a YouTube video should play the video or the audio file. Defaults to video. +export const media_preference = writable