This commit is contained in:
2023-10-15 18:24:43 +02:00
parent 78f3961b11
commit 5bee1b6382
5 changed files with 94 additions and 43 deletions

View File

@@ -8,9 +8,10 @@ const db = new Database(dbName);
export function getStreams() {
const indexData = db.prepare('SELECT id, stream_date, title, tags, length_seconds ' +
'FROM Stream ORDER BY id DESC').all();
indexData.forEach(stream =>
stream['stream_date'] = Date.parse(stream['stream_date'])
);
indexData.forEach(stream => {
stream['stream_date'] = Date.parse(stream['stream_date']);
stream['tags'] = JSON.parse(stream['tags']);
});
return indexData;
}

View File

@@ -2,6 +2,33 @@ import { writable } from 'svelte/store';
export const currentStream = writable({});
export const currentSongIndex = writable(0);
export const tagList = [
'acoustic',
'electronic',
'orchestral',
'rock',
'pop',
'metal',
'aggressive',
'folk',
'jazzy',
'dance.music',
'untz',
'breakbeats',
'electronica',
'chiptune',
'left.field',
'denpa',
'vocaloid',
'funky',
'lush',
'noisy',
'psychedelic',
'dark',
'calm',
'moody',
'uplifting'
];
let timestampList;