@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 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:3000 in your browser.
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: 3000) |
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:3000/webdav/`). It mirrors your music folder structure. No authentication required.
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>:3000/webdav/`
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 3000)
107
+ │ HTTP (port 4534)
108
108
  ┌──────────▼───────────┐
109
109
  │ Express Server │
110
110
  │ ┌─────────────────┐ │
@@ -16,7 +16,7 @@ function detectLanIp() {
16
16
  return '127.0.0.1';
17
17
  }
18
18
  export const config = {
19
- port: 3000,
19
+ port: 4534,
20
20
  host: detectLanIp(),
21
21
  musicPaths: [],
22
22
  dataDir: path.resolve(import.meta.dirname, '..', 'data'),
@@ -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', '3000')
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`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@amoshydra/davison",
3
- "version": "0.0.3",
3
+ "version": "0.0.4",
4
4
  "description": "WebDAV music server + Sonos controller. npx @amoshydra/davison --path /music",
5
5
  "type": "module",
6
6
  "bin": {