feat: added playlist option
All checks were successful
Build and Push Docker Image / docker (push) Successful in 10s

This commit is contained in:
2025-10-12 15:32:53 +02:00
parent 3f52382cdc
commit 17faca1f46
22 changed files with 28651 additions and 10272 deletions

View File

@@ -4,10 +4,28 @@ import { onMessage } from './handlers.js';
import { wireUi } from './ui.js';
import { $nameLobby } from './dom.js';
// Fetch and store available playlists
async function loadPlaylists() {
try {
const response = await fetch('/api/playlists');
const data = await response.json();
if (data.ok && data.playlists) {
state.playlists = data.playlists;
return data.playlists;
}
} catch (error) {
console.error('Failed to load playlists:', error);
}
return [];
}
// Initialize UI and open WebSocket connection
wireUi();
connectWS(onMessage);
// Load playlists on startup
loadPlaylists();
// Restore name/id immediately for initial render smoothness
(() => {
try {