diff --git a/.gitignore b/.gitignore index 321f6e2..aa77ef8 100644 --- a/.gitignore +++ b/.gitignore @@ -36,3 +36,5 @@ report.[0-9]_.[0-9]_.[0-9]_.[0-9]_.json tmp/ library_cache.db musicroom.db +blastoise.db +config.json diff --git a/README.md b/README.md index 00ed647..cd2948e 100644 --- a/README.md +++ b/README.md @@ -1,15 +1,21 @@ -# NeoRose +# Blastoise -To install dependencies: +Everything that I've wanted out of a networked music player. Self-host. Play your music through the server, but also cache all the tracks locally. + +But most importantly, listen to the same stuff as your friends. + +Its actually more of a file downloader than a normal music streamer. Built with bun. + +First time setup: ```bash bun install ``` -To run: +to launch the server ```bash -bun run +bun run server.ts ``` -This project was created using `bun init` in bun v1.3.8. [Bun](https://bun.com) is a fast all-in-one JavaScript runtime. +have a look at the config.json that gets created the first time. diff --git a/auth.ts b/auth.ts index 4d9bb98..3f59feb 100644 --- a/auth.ts +++ b/auth.ts @@ -1,6 +1,6 @@ import { validateSession, hasPermission, type User } from "./db"; -const COOKIE_NAME = "musicroom_session"; +const COOKIE_NAME = "blastoise_session"; export function getSessionToken(req: Request): string | null { const cookie = req.headers.get("cookie"); diff --git a/bun.lock b/bun.lock index 6e038d0..5804e63 100644 --- a/bun.lock +++ b/bun.lock @@ -3,7 +3,7 @@ "configVersion": 1, "workspaces": { "": { - "name": "musicroom", + "name": "blastoise", "dependencies": { "music-metadata": "^11.11.2", }, diff --git a/db.ts b/db.ts index ee6164f..2d14310 100644 --- a/db.ts +++ b/db.ts @@ -1,6 +1,6 @@ import { Database } from "bun:sqlite"; -const DB_PATH = "./musicroom.db"; +const DB_PATH = "./blastoise.db"; const SESSION_EXPIRY_DAYS = 7; const GUEST_SESSION_EXPIRY_HOURS = 24; diff --git a/music/music_goes_here.txt b/music/music_goes_here.txt new file mode 100644 index 0000000..e69de29 diff --git a/package.json b/package.json index 7ac39ca..6db1b25 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "musicroom", + "name": "blastoise", "version": "1.0.0", "scripts": { "start": "bun run server.ts" diff --git a/public/audioCache.js b/public/audioCache.js index 7a30a87..078fc66 100644 --- a/public/audioCache.js +++ b/public/audioCache.js @@ -5,12 +5,12 @@ const M = window.MusicRoom; // Load stream-only preference from localStorage - M.streamOnly = localStorage.getItem("musicroom_streamOnly") === "true"; + M.streamOnly = localStorage.getItem("blastoise_streamOnly") === "true"; // Toggle stream-only mode M.setStreamOnly = function(enabled) { M.streamOnly = enabled; - localStorage.setItem("musicroom_streamOnly", enabled ? "true" : "false"); + localStorage.setItem("blastoise_streamOnly", enabled ? "true" : "false"); M.showToast(enabled ? "Stream-only mode enabled" : "Caching enabled"); }; diff --git a/public/channelSync.js b/public/channelSync.js index ca2bd9a..b9ebbe9 100644 --- a/public/channelSync.js +++ b/public/channelSync.js @@ -16,7 +16,7 @@ M.channels = channels; M.renderChannelList(); // Try saved channel first, fall back to default - const savedChannelId = localStorage.getItem("musicroom_channel"); + const savedChannelId = localStorage.getItem("blastoise_channel"); const savedChannel = savedChannelId && channels.find(c => c.id === savedChannelId); const targetChannel = savedChannel || channels.find(c => c.isDefault) || channels[0]; M.connectChannel(targetChannel.id); @@ -158,7 +158,7 @@ oldWs.close(); } M.currentChannelId = id; - localStorage.setItem("musicroom_channel", id); + localStorage.setItem("blastoise_channel", id); const proto = location.protocol === "https:" ? "wss:" : "ws:"; M.ws = new WebSocket(proto + "//" + location.host + "/api/channels/" + id + "/ws"); diff --git a/public/core.js b/public/core.js index bcef3ad..9de1c45 100644 --- a/public/core.js +++ b/public/core.js @@ -24,7 +24,7 @@ window.MusicRoom = { // Volume preMuteVolume: 1, - STORAGE_KEY: "musicroom_volume", + STORAGE_KEY: "blastoise_volume", // Playback state localTimestamp: 0, diff --git a/public/index.html b/public/index.html index aaea4a9..8c40c89 100644 --- a/public/index.html +++ b/public/index.html @@ -8,7 +8,7 @@
-

MusicRoom

+

Blastoise

Sign in to continue

diff --git a/public/trackStorage.js b/public/trackStorage.js index b658ad6..43183cb 100644 --- a/public/trackStorage.js +++ b/public/trackStorage.js @@ -3,7 +3,7 @@ // Default implementation uses IndexedDB, can be swapped for Electron file API const TrackStorage = (function() { - const DB_NAME = 'musicroom'; + const DB_NAME = 'blastoise'; const DB_VERSION = 1; const STORE_NAME = 'tracks'; diff --git a/server.ts b/server.ts index e1f6fdc..9d72866 100644 --- a/server.ts +++ b/server.ts @@ -619,7 +619,7 @@ serve({ // Auth: logout if (path === "/api/auth/logout" && req.method === "POST") { - const token = req.headers.get("cookie")?.match(/musicroom_session=([^;]+)/)?.[1]; + const token = req.headers.get("cookie")?.match(/blastoise_session=([^;]+)/)?.[1]; if (token) { const user = validateSession(token); console.log(`[AUTH] Logout: user="${user?.username ?? "unknown"}" session=${token}`);