Files
conjurer/navidrome_bridge/env.example
T
Michal Tuszowski 7f652aa9db navidrome_bridge: one-click radio requests from Navidrome
Star a track in Navidrome and it lands in betoniarka's request queue.

EXTERNAL component: imports nothing from Conjurer and bypasses the Discord bot
and its API entirely. It speaks only to Navidrome's Subsonic API and to the
radio operator, so the bot can be down and this keeps working.

Not shipped as a .ndp plugin, deliberately. Navidrome's plugin capabilities are
MetadataAgent, Scrobbler, Lyrics, SonicSimilarity, TaskWorker, Lifecycle,
SchedulerCallback and WebSocketCallback - there is no UI extension capability
(a plugin cannot add a button) and no star/love event to react to. The only
plugin-shaped alternative, Scrobbler, sees every track played, which is a
firehose rather than a one-click request. So the trigger is Navidrome's own
star control, which also works from any Subsonic client including phones.
The README documents this with sources.

Both sides index the same library under different mount points, so every path
is translated between the two roots; paths reported relative to Navidrome's
library are handled as well as absolute ones.

Two delivery modes: "api" (default) posts to /request_radio_file and needs no
shared filesystem, at the cost of the radio re-finding the track by keywords;
"playlist" appends the exact translated path and is exact but needs the radio's
data dir mounted. The api path prepends a sentinel token because betoniarka's
wyszukaj() drops lista_slow[0], where the Discord command word normally sits.

Verified: path translation for both absolute and relative forms; keyword
extraction (no regex metacharacters, extension dropped, Polish characters
intact); and an end-to-end check feeding the generated keywords through
betoniarka's real wyszukaj() against a library seeded with near-miss traps
(same artist, live version of the same title, same album name under another
artist) - it resolved to the exact intended file.

Docker/compose/systemd install paths documented. Not run against a live
Navidrome or radio - no instance reachable from here.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-21 19:28:46 +02:00

49 lines
2.1 KiB
Plaintext

# Copy to .env and fill in. Do NOT commit the real file.
# --- Navidrome (read-only Subsonic API; the password is never sent in clear) --
NAVIDROME_URL=http://navidrome:4533
NAVIDROME_USER=your-navidrome-user
NAVIDROME_PASSWORD=your-navidrome-password
# --- Path translation ----------------------------------------------------
# The SAME mp3 library, mounted at two different points. Whatever prefix
# Navidrome reports is stripped and replaced with the radio's mount point.
# Check the Navidrome side with:
# docker exec navidrome printenv ND_MUSICFOLDER
# and the radio side with the betoniarka container's BETONIARKA_MUSIC.
NAVIDROME_LIBRARY_ROOT=/music
BETONIARKA_LIBRARY_ROOT=/srv/betoniarka/music
# --- Radio (betoniarka) --------------------------------------------------
BETONIARKA_URL=http://radio-vm:5005
# Same shared secret the radio runs with (empty = the radio has auth disabled).
CONJURER_API_KEY=
# How the request reaches the radio:
# api - POST /request_radio_file over the network. No shared filesystem.
# The radio re-finds the track from keywords, so it is a fuzzy
# match (accurate in practice - full path tokens are very
# distinctive - but not guaranteed).
# playlist - append the exact translated path to the request playlist.
# Exact, but needs the radio's data dir mounted here.
BRIDGE_MODE=api
BETONIARKA_REQUEST_PLAYLIST=/srv/betoniarka/data/request.playlist
# --- Behaviour -----------------------------------------------------------
# How often to look for newly starred tracks.
BRIDGE_POLL_SECONDS=15
BRIDGE_STATE_FILE=/data/queued.json
# Un-star a track once it has been queued, turning the heart into a
# fire-and-forget "send to radio" button that resets itself. Leave false if you
# use stars as real favourites.
BRIDGE_UNSTAR_AFTER_QUEUE=false
# On the very first run, treat everything already starred as handled, so
# enabling the bridge does not dump your whole favourites list into the radio.
BRIDGE_SKIP_EXISTING_ON_FIRST_RUN=true
# Log what would be sent without sending anything - use this to verify the two
# library roots line up before going live.
BRIDGE_DRY_RUN=false