silver-music-notifier 0.1.0 → 1.1.0

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
@@ -10,9 +10,27 @@ local web UI (built with [silver-ui](https://silver-ui.com)).
10
10
  npm install -g silver-music-notifier
11
11
  ```
12
12
 
13
+ Requires Node.js 22.12.0 or newer.
14
+
13
15
  This requires a working build toolchain for `better-sqlite3` (the native SQLite
14
16
  driver), which is built automatically on install.
15
17
 
18
+ ## MusicBrainz contact (required)
19
+
20
+ MusicBrainz requires every API client to identify a contact (an email or URL) in
21
+ its User-Agent, and throttles or blocks requests without one. The first time you
22
+ run most CLI commands, the CLI **prompts you for a contact** and saves it.
23
+ Non-network setup commands such as `config set`, `clear-data`, and `dismiss`
24
+ can run before the contact is configured. You can also set it ahead of time:
25
+
26
+ ```bash
27
+ silver-music-notifier config set musicbrainz.contact you@example.com
28
+ ```
29
+
30
+ or in the web UI's **Settings** view after the app has launched. In a
31
+ non-interactive context (no TTY), commands that require the contact error with
32
+ this guidance instead of prompting.
33
+
16
34
  ## Usage
17
35
 
18
36
  ### Web UI
@@ -27,7 +45,8 @@ The UI has three views:
27
45
  - **Releases** — a feed of every known release-group, newest first, with a
28
46
  **Refresh** button and a "New" badge on releases discovered in the last refresh.
29
47
  - **Artists** — search MusicBrainz and add/remove the artists you follow.
30
- - **Settings** — choose notification methods and configure SMTP for email.
48
+ - **Settings** — set the MusicBrainz contact (required), choose notification
49
+ methods, and configure SMTP for email.
31
50
 
32
51
  ### CLI
33
52
 
@@ -38,50 +57,71 @@ silver-music-notifier add "X" --mbid <mbid> # add an exact MBID
38
57
  silver-music-notifier list # list tracked artists
39
58
  silver-music-notifier remove "Radiohead" # stop tracking (by name or MBID)
40
59
  silver-music-notifier refresh # fetch releases + notify on new ones
60
+ silver-music-notifier refresh --no-notify # fetch without sending email
41
61
  silver-music-notifier releases --new --limit 20
62
+ silver-music-notifier dismiss <release-mbid> # hide a release's New badge
42
63
  silver-music-notifier config get # show settings
43
- silver-music-notifier config set notify.desktop false
64
+ silver-music-notifier config set notify.email true
65
+ silver-music-notifier clear-data # delete artists/releases, keep settings
44
66
  ```
45
67
 
46
68
  ## Notifications
47
69
 
48
- When `refresh` finds releases it has never seen before, it can notify you three ways:
70
+ When `refresh` finds releases it has never seen before, it can notify you two ways:
49
71
 
50
72
  - **In-page badges** — "New" badges in the web UI (always available).
51
- - **Desktop** — a system notification (enabled by default).
52
- - **Email** an HTML summary, sent once SMTP is configured and the email toggle
53
- is on. Configure it in the **Settings** view or via `config set smtp.*`.
73
+ - **Email** — one HTML email per new release, sent once SMTP is configured and
74
+ the email toggle is on. Configure it in the **Settings** view or via
75
+ `config set smtp.host`, `smtp.port`, `smtp.secure`, `smtp.user`, `smtp.pass`,
76
+ `smtp.from`, and `smtp.to`.
77
+
78
+ Adding a new artist refreshes that artist immediately, but treats the existing
79
+ catalog as your starting baseline: it does not send email for those releases or
80
+ mark them with "New" badges.
54
81
 
55
82
  `refresh` is manual — run it from the CLI, the web button, or your own scheduler
56
83
  (cron, systemd timer, etc.).
57
84
 
58
- ## Data & configuration
85
+ ### Cron refresh
59
86
 
60
- State lives in a single SQLite file in your per-user data directory
61
- (e.g. `~/.config/silver-music-notifier/data.db` on Linux). Override the location
62
- with the `SMN_DATA_DIR` environment variable.
87
+ To check for new releases on a schedule, first make sure the CLI has the required
88
+ MusicBrainz contact and any notification settings configured:
63
89
 
64
- > **Note:** SMTP credentials (including the password) are stored in plaintext in
65
- > that local SQLite file. This is a single-user local tool; treat the data
66
- > directory accordingly.
90
+ ```bash
91
+ silver-music-notifier config set musicbrainz.contact you@example.com
92
+ silver-music-notifier config set notify.email true # optional, if SMTP is configured
93
+ ```
67
94
 
68
- Other environment variables:
95
+ Then add a cron entry. This example refreshes every day at 9:00 AM:
69
96
 
70
- - `SMN_DATA_DIR` — override the data directory.
71
- - `SMN_DISABLE_DESKTOP=1` suppress desktop notifications.
72
- - `SMN_MB_CONTACT` — fallback MusicBrainz contact for the API User-Agent.
97
+ ```cron
98
+ 0 9 * * * /usr/bin/env silver-music-notifier refresh >> "$HOME/.local/share/silver-music-notifier/cron.log" 2>&1
99
+ ```
73
100
 
74
- ## Development
101
+ If cron cannot find the command, use the full path from
102
+ `command -v silver-music-notifier`. To use a custom database location, set
103
+ `SILVER_MUSIC_NOTIFIER_DATA_DIR` in the cron line:
75
104
 
76
- ```bash
77
- npm install
78
- npm run dev # backend (tsx watch, :3001) + Vite dev server (:5173, proxies /api)
79
- npm run build # bundle CLI/server (tsup) + build web (vite) into dist/
80
- npm run typecheck
81
- npm run lint # eslint
82
- npm run lint:fix # eslint --fix
83
- npm run format # prettier --write .
105
+ ```cron
106
+ 0 9 * * *
107
+ SILVER_MUSIC_NOTIFIER_DATA_DIR="$HOME/.local/share/silver-music-notifier" /usr/bin/env silver-music-notifier refresh >> "$HOME/.local/share/silver-music-notifier/cron.log" 2>&1
84
108
  ```
85
109
 
86
- A Husky `pre-commit` hook runs `lint-staged` (eslint `--fix` then prettier on
87
- staged files) followed by `typecheck`, so commits are auto-formatted and linted.
110
+ ## Data & configuration
111
+
112
+ State lives in a single SQLite file (`data.db`) in your per-user data directory:
113
+
114
+ - **Linux:** `$XDG_DATA_HOME/silver-music-notifier` (usually `~/.local/share/silver-music-notifier`)
115
+ - **macOS:** `~/Library/Application Support/silver-music-notifier`
116
+ - **Windows:** `%LOCALAPPDATA%\silver-music-notifier\Data`
117
+
118
+ Override the location with the `SILVER_MUSIC_NOTIFIER_DATA_DIR` environment
119
+ variable.
120
+
121
+ > **Note:** SMTP credentials (including the password) are stored in plaintext in
122
+ > that local SQLite file. This is a single-user local tool; treat the data
123
+ > directory accordingly.
124
+
125
+ Notification methods (in-page / email) and the MusicBrainz contact are
126
+ configured in the web UI's **Settings** view or via `silver-music-notifier
127
+ config set …` — not through environment variables.