Skip to content

andykelk/navidrome-ntfy-plugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

navidrome-ntfy — New Album Notifications Plugin

A Navidrome plugin that watches your music library for newly added albums and pushes a notification to an ntfy topic for each one discovered.

How it works

  1. On startup (nd_on_init) the plugin schedules a recurring cron job (default: every minute).
  2. On each tick it calls the internal Subsonic API (getAlbumList2?type=newest) to fetch the 20 most recently added albums.
  3. It compares the results against the last known album ID stored in KVStore. Any albums that appear before (i.e. newer than) that watermark are considered new.
  4. For each new album it sends an HTTP POST to the configured ntfy topic URL.
  5. After all notifications are sent successfully it updates the KVStore watermark. If a POST fails the watermark is not updated, so the album will be retried on the next tick.

First run: On the very first poll the plugin establishes the watermark without sending any notifications, preventing a flood of alerts for your entire existing library.

Requirements

  • Navidrome with the plugin system enabled (see plugin docs)
  • TinyGo to build the .wasm binary
  • An ntfy server (self-hosted or ntfy.sh)

Build & install

# 1. Build the WebAssembly module
make build

# 2. Package as .ndp
make package          # produces navidrome-ntfy.ndp

# 3. Copy to your Navidrome plugins folder
cp navidrome-ntfy.ndp /path/to/navidrome/plugins/

# 4. Enable plugins in navidrome.toml (if not already)
# [Plugins]
# Enabled = true
# Folder  = "/path/to/plugins"

Configuration

Set these values in the Navidrome web UI under Settings → Plugins → ntfy New Album Notifications:

Key Required Description
ntfy_url Yes Full ntfy topic URL, e.g. https://ntfy.example.com/music
subsonic_user Yes Navidrome username the plugin uses for internal Subsonic API calls. The user must be granted access to this plugin in the Users section of the plugin settings.
ntfy_token No Bearer token for authenticated ntfy instances. Leave blank for public topics.
poll_interval No Cron expression override. Default: */1 * * * * (every minute).

User access

Because this plugin uses the subsonicapi permission it requires at least one Navidrome user to be assigned to it. In the plugin settings page either:

  • Enable Allow all users, or
  • Select a specific user from the list (a dedicated read-only account is recommended).

Notification format

Each notification looks like this in ntfy:

Field Value
Body New album added: {Album Title} — {Artist Name}
Title New Album in Navidrome
Priority default
Tags musical_note

KVStore key

Key Description
last_seen_album_id Album ID of the most recently notified album. Delete this key (via the Navidrome debug tools) to reset the watermark.

Development

# Clean build artefacts
make clean

# Rebuild and repackage in one step
make

The replace directive in go.mod points to the PDK sources inside the Navidrome repository. Adjust the path if your working tree is structured differently:

replace github.com/navidrome/navidrome/plugins/pdk/go => ../navidrome/plugins/pdk/go

About

Navidrome plugin: push notifications via ntfy when new albums are added

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors