commit fb1291eab9294a1c262c7007d822a287bef8faa4
parent 452748bdea62c9dd85bd25d9f3b2d32e8a74ae65
Author: Hunter
Date: Mon, 10 Nov 2025 20:27:29 -0500
move tracks.json to /tracks; host.py: print server addresses last
Diffstat:
6 files changed, 13 insertions(+), 10 deletions(-)
diff --git a/.gitignore b/.gitignore
@@ -6,8 +6,8 @@ __pycache__/
*.pyd
# Tracks and playlists
-tracks/
-tracks.json
+tracks/*
+!tracks/readme.md
resources/album_art.jpg
# macOS
diff --git a/generate_manifests.py b/generate_manifests.py
@@ -58,7 +58,7 @@ APP_DESCRIPTION = f"{APP_NAME} · vibe capsule"
# File paths (no need to edit these)
SCRIPT_DIR = Path(__file__).parent.absolute()
-TRACKS_JSON = SCRIPT_DIR / "tracks.json"
+TRACKS_JSON = SCRIPT_DIR / "tracks" / "tracks.json"
STYLES_CSS = SCRIPT_DIR / "styles.css"
@@ -133,7 +133,7 @@ def generate_pwa_manifests():
"index.html",
"styles.css",
"script.js",
- "tracks.json",
+ "tracks/tracks.json",
"resources/icon.png",
"resources/play.png",
"resources/pause.png",
diff --git a/host.py b/host.py
@@ -156,14 +156,13 @@ def start_server():
print("💿 vibe capsule")
print("=" * 60)
print(f"\nServer running on port {port}")
- print(f"\nLocal access: {local_url}")
- print(f"Network access: {network_url}")
# Print QR code for easy mobile access
print_qr_code(network_url)
- print("Press Ctrl+C to stop the server")
- print("=" * 60)
+ print(f"Local access: {local_url}")
+ print(f"Network access: {network_url}")
+ print("\nPress Ctrl+C to stop the server")
# Serve forever
httpd.serve_forever()
diff --git a/scan.py b/scan.py
@@ -13,7 +13,7 @@ from pathlib import Path
SCRIPT_DIR = Path(__file__).parent.absolute()
VENV_DIR = SCRIPT_DIR / "venv"
TRACKS_DIR = SCRIPT_DIR / "tracks"
-OUTPUT_FILE = SCRIPT_DIR / "tracks.json"
+OUTPUT_FILE = TRACKS_DIR / "tracks.json"
REQUIREMENTS_FILE = SCRIPT_DIR / "requirements.txt"
diff --git a/script.js b/script.js
@@ -55,7 +55,7 @@ fetch('manifest.json')
console.log('Using cache name:', CACHE_NAME);
// Now that we have CACHE_NAME, load tracks
- return fetch('tracks.json');
+ return fetch('tracks/tracks.json');
})
.then(response => {
if (!response.ok) {
diff --git a/tracks/readme.md b/tracks/readme.md
@@ -0,0 +1,3 @@
+# /tracks
+
+add your .mp3 files here, then run `scan.py` to create `tracks.json`.
+\ No newline at end of file