move tracks.json to /tracks; host.py: print server addresses last
Hunter
Monday, November 10th, 2025 at 8:27 PM
6 *.pyd
7
8 # Tracks and playlists
-tracks/
-tracks.json
9 +tracks/*
10 +!tracks/readme.md
11 resources/album_art.jpg
12
13 # macOS
58
59 # File paths (no need to edit these)
60 SCRIPT_DIR = Path(__file__).parent.absolute()
-TRACKS_JSON = SCRIPT_DIR / "tracks.json"
61 +TRACKS_JSON = SCRIPT_DIR / "tracks" / "tracks.json"
62 STYLES_CSS = SCRIPT_DIR / "styles.css"
63
64
133 "index.html",
134 "styles.css",
135 "script.js",
- "tracks.json",
136 + "tracks/tracks.json",
137 "resources/icon.png",
138 "resources/play.png",
139 "resources/pause.png",
156 print("💿 vibe capsule")
157 print("=" * 60)
158 print(f"\nServer running on port {port}")
- print(f"\nLocal access: {local_url}")
- print(f"Network access: {network_url}")
159
160 # Print QR code for easy mobile access
161 print_qr_code(network_url)
162
- print("Press Ctrl+C to stop the server")
- print("=" * 60)
163 + print(f"Local access: {local_url}")
164 + print(f"Network access: {network_url}")
165 + print("\nPress Ctrl+C to stop the server")
166
167 # Serve forever
168 httpd.serve_forever()
13 SCRIPT_DIR = Path(__file__).parent.absolute()
14 VENV_DIR = SCRIPT_DIR / "venv"
15 TRACKS_DIR = SCRIPT_DIR / "tracks"
-OUTPUT_FILE = SCRIPT_DIR / "tracks.json"
16 +OUTPUT_FILE = TRACKS_DIR / "tracks.json"
17 REQUIREMENTS_FILE = SCRIPT_DIR / "requirements.txt"
18
19
55 console.log('Using cache name:', CACHE_NAME);
56
57 // Now that we have CACHE_NAME, load tracks
- return fetch('tracks.json');
58 + return fetch('tracks/tracks.json');
59 })
60 .then(response => {
61 if (!response.ok) {
1 +# /tracks
2 +
3 +add your .mp3 files here, then run `scan.py` to create `tracks.json`.