add stream caching ("offline mode")
This commit is contained in:
+2
-1
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user