complete except for drag&drop queue reordering and sorting

This commit is contained in:
Jurn Wubben 2026-02-02 23:13:05 +01:00
parent 63dec0ede2
commit ccbb7fcd13
5 changed files with 532 additions and 17 deletions

View file

@ -1,12 +1,11 @@
import { SpotifyWS } from "./spotify.ts"
import { HeartbeatWS } from "./heartbeat.ts";
import { PlayerManager } from "./playerManager.ts";
import { serveFile } from "@std/http/file-server";
import { serveDir } from "@std/http/file-server";
import { UserWS } from "./user.ts";
const USER_PATTERN = new URLPattern({pathname: "/ws/user"})
const SPOTIFY_PATTERN = new URLPattern({pathname: "/ws/spotify"})
const song = "spotify:track:2VxJVGiTsK6UyrxPJJ2lR9";
function commonWs(req: Request) {
const { socket, response } = Deno.upgradeWebSocket(req);
@ -33,11 +32,11 @@ Deno.serve((req) => {
const spState = spotify?.ws.readyState;
if (spState !== undefined && spState !== WebSocket.CLOSED) spotify?.ws.close();
spotify = new SpotifyWS(socket, () => song);
new SpotifyWS(socket);
new HeartbeatWS(socket);
return response
}
return serveFile(req, "./static/index.html")
return serveDir(req, {fsRoot: "./static", urlRoot: ""})
})