@amoshydra/davison 0.0.3 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -5
- package/dist-server/config.js +1 -1
- package/dist-server/index.js +5 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -24,7 +24,7 @@ A standalone music server that streams your local music library to Sonos speaker
|
|
|
24
24
|
npx davison --path /path/to/music
|
|
25
25
|
```
|
|
26
26
|
|
|
27
|
-
Open http://localhost:
|
|
27
|
+
Open http://localhost:4534 in your browser.
|
|
28
28
|
|
|
29
29
|
### Via Docker
|
|
30
30
|
|
|
@@ -59,7 +59,7 @@ services:
|
|
|
59
59
|
| Option | Description |
|
|
60
60
|
|--------|-------------|
|
|
61
61
|
| `-p, --path <paths...>` | One or more music directories (required) |
|
|
62
|
-
| `--port <number>` | Server port (default:
|
|
62
|
+
| `--port <number>` | Server port (default: 4534) |
|
|
63
63
|
| `--host <address>` | LAN address (auto-detected if omitted) |
|
|
64
64
|
|
|
65
65
|
### Web UI
|
|
@@ -74,11 +74,11 @@ services:
|
|
|
74
74
|
|
|
75
75
|
### WebDAV
|
|
76
76
|
|
|
77
|
-
The WebDAV server is available at `/webdav` (e.g., `http://192.168.0.x:
|
|
77
|
+
The WebDAV server is available at `/webdav` (e.g., `http://192.168.0.x:4534/webdav/`). It mirrors your music folder structure. No authentication required.
|
|
78
78
|
|
|
79
79
|
To use with Music Assistant:
|
|
80
80
|
1. Add a **WebDAV** provider
|
|
81
|
-
2. URL: `http://<your-server-ip>:
|
|
81
|
+
2. URL: `http://<your-server-ip>:4534/webdav/`
|
|
82
82
|
3. Leave username/password blank
|
|
83
83
|
4. Content type: `music`
|
|
84
84
|
|
|
@@ -104,7 +104,7 @@ The dev server hot-reloads on file changes.
|
|
|
104
104
|
│ Web Browser │
|
|
105
105
|
│ (React + Vite) │
|
|
106
106
|
└──────────┬───────────┘
|
|
107
|
-
│ HTTP (port
|
|
107
|
+
│ HTTP (port 4534)
|
|
108
108
|
┌──────────▼───────────┐
|
|
109
109
|
│ Express Server │
|
|
110
110
|
│ ┌─────────────────┐ │
|
package/dist-server/config.js
CHANGED
package/dist-server/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import express from 'express';
|
|
2
2
|
import ViteExpress from 'vite-express';
|
|
3
|
-
import { resolve, dirname } from 'node:path';
|
|
3
|
+
import { resolve, dirname, isAbsolute } from 'node:path';
|
|
4
4
|
import { fileURLToPath } from 'node:url';
|
|
5
5
|
import { Command } from 'commander';
|
|
6
6
|
import { config } from './config.js';
|
|
@@ -14,7 +14,7 @@ program
|
|
|
14
14
|
.name('davison')
|
|
15
15
|
.description('Sonos music player with web UI')
|
|
16
16
|
.option('-p, --path <paths...>', 'Path(s) to music directories')
|
|
17
|
-
.option('--port <number>', 'Server port', '
|
|
17
|
+
.option('--port <number>', 'Server port', '4534')
|
|
18
18
|
.option('--host <address>', 'Server LAN address (auto-detected if omitted)')
|
|
19
19
|
.parse(process.argv);
|
|
20
20
|
const options = program.opts();
|
|
@@ -22,6 +22,9 @@ config.port = parseInt(options.port, 10) || 3000;
|
|
|
22
22
|
if (options.host)
|
|
23
23
|
config.host = options.host;
|
|
24
24
|
config.musicPaths = options.path || [];
|
|
25
|
+
// Resolve relative paths against original cwd before main() may chdir
|
|
26
|
+
const originalCwd = process.cwd();
|
|
27
|
+
config.musicPaths = config.musicPaths.map((p) => isAbsolute(p) ? p : resolve(originalCwd, p));
|
|
25
28
|
config.musicPaths.forEach(p => {
|
|
26
29
|
if (p.includes(' ')) {
|
|
27
30
|
console.warn(`Warning: path "${p}" contains spaces — ensure it was quoted in the shell`);
|