add stream caching ("offline mode")

This commit is contained in:
2026-03-16 20:32:33 +01:00
parent 8573b82515
commit 3aa762d544
12 changed files with 153 additions and 17 deletions
+2 -1
View File
@@ -9,12 +9,13 @@ const db = new Database(dbName);
export function getStreams(): StreamSummary[] {
const indexData = db
.prepare(
'SELECT id, stream_date, title, tags, length_seconds ' + 'FROM Stream ORDER BY id DESC'
'SELECT id, stream_date, filename, title, tags, length_seconds ' + 'FROM Stream ORDER BY id DESC'
)
.all() as Record<string, unknown>[];
return indexData.map((stream) => ({
id: stream.id as string,
stream_date: Date.parse(stream.stream_date as string),
filename: stream.filename as string,
title: stream.title as string | null,
tags: JSON.parse(stream.tags as string) as string[],
length_seconds: stream.length_seconds as number