As posted in another thread on this forum, I created a Roon Extension for selecting albums at random.
I also made one for LMS. Same UI. Can be found here
Random Albums for Lyrion Music Server
A one-screen “what should I play?” front door for your Lyrion Music Server (LMS) library. Open it and you get a wall of random album covers from your own collection. Tap one, it plays. Search is there when you know what you want — and it reaches into the Qobuz catalogue too, so you can play and favourite albums you don’t own yet.
It’s a tiny standalone web app (Node.js + Express, one dependency). Nothing gets installed into LMS — no plugin, no app store, no account. It runs anywhere on your network, talks to LMS over its normal interfaces, and installs to your phone’s home screen as a PWA.
Why this instead of “just opening a Lyrion remote”?
LMS already has excellent full-featured controllers — LyrPlay, the built-in web UI, Material Skin, iPeng, Squeezer, OrangeSqueeze, and others. They’re great when you want to manage your music: browse the whole library, dig through artists and genres, manage the play queue, tweak settings and plugins.
But a lot of listening doesn’t start with a decision — it starts with “I don’t know what to put on.” A full controller answers that by dropping you into menus and a search box and asking you to choose. That’s friction at exactly the wrong moment.
Random Albums flips it around:
- It opens straight to a wall of random album art from your library. You don’t search — you browse by eye, the way you would flicking through a record shelf. See something you fancy, tap it, it’s playing in two taps.
- One focused screen. No settings trees, no plugin menus, no queue micromanagement. Just albums and playback.
- Search is the fallback, not the front door — and it’s smarter for discovery, because it also surfaces matching albums from the Qobuz catalogue (badged “From Qobuz”) that you can play instantly or add to your Qobuz favourites with a tap of the heart.
- Zero install into LMS. It’s not a plugin. It’s a small web server that sits beside LMS and talks to it over the network, so it can’t destabilise your server and is trivial to add or remove.
- Feels like an app. Add it to your home screen and it runs full-screen as a PWA, perfect for a phone, a kitchen tablet, or a wall-mounted display.
It’s meant to complement your full controller, not replace it. Keep your favourite remote for deep library work; reach for Random Albums when you just want music on, fast.
Features
Discovery
- A responsive wall of random albums drawn from your LMS library, sized to fill the screen.
- Reshuffle button for a fresh set whenever you want one.
- Library album count shown at a glance.
Playback
- Tap any album for a detail view with cover art, title, artist, year, and the full track list.
- Play Now, Add to Queue, Play Next, and Shuffle for any album.
- Play from here — start the queue from any track in an album.
- Audio-output / player picker to choose which Squeezebox/LMS player you’re controlling, and transfer playback between players/zones.
- A persistent now-playing bar: current track + art, play/pause, previous/next, and volume.
Search
- Live, as-you-type search across album titles and artists, with accent-folding and sensible ranking (an “iron maiden” search finds Iron Maiden albums even when the words aren’t in the title).
- Qobuz online-catalogue search: matching albums you don’t own appear under a “From Qobuz” divider with a badge. Open them for the track list, play them (Play Now / Queue / Play Next / Shuffle), and add or remove them from your Qobuz favourites with a compact heart toggle — favourited albums get scanned into your library by LMS automatically.
Extras
- About this album — release year (via MusicBrainz) and an editorial bio (via Qobuz / Wikipedia) where available.
- Share card — generate a clean shareable image of an album.
- Light / dark theme toggle.
- Installable PWA with a network-first service worker, so the home-screen app always picks up new versions on launch.
Under the hood
- Single standalone Node.js + Express app; the only runtime dependency is Express.
- Talks to LMS over its JSON-RPC interface for everything library/playback, and over the command-line interface (CLI) for the asynchronous Qobuz catalogue menus.
- In-memory caching and a paginated library index so it stays responsive even on large libraries and modest hardware (e.g. a Raspberry Pi / DietPi box).
Requirements
- Node.js 18 or newer (the LTS release is recommended). The app uses the built-in
fetch, so Node 18+ is required. - A running Lyrion Music Server reachable from wherever you run this app. Note its hostname/IP and web port (default 9000).
- For Qobuz catalogue search (optional): the Qobuz plugin installed and working in LMS, and the LMS Command Line Interface enabled on its default port 9090 (Settings → Advanced → enable the CLI / “Squeezebox CLI”). Without these, the rest of the app works exactly the same — the “From Qobuz” section is simply omitted.
The app and LMS don’t have to be on the same machine. If they are, the defaults (
127.0.0.1:9000) work out of the box.
Installation
Latest version Release v1.0.0 · meltface-80/LMS---Random-Album-Selector · GitHub
The flow is the same on every platform: install Node → get the code → npm install → run it, pointing it at your LMS. Pick your OS below.
Configuration via environment variables
You configure the app entirely with environment variables (all optional):
| Variable | Default | Description |
|---|---|---|
PORT |
3399 |
Port the web UI listens on. |
LMS_HOST |
127.0.0.1 |
Hostname / IP of your Lyrion Music Server. |
LMS_PORT |
9000 |
LMS web / JSON-RPC port. |
LMS_CLI_PORT |
9090 |
LMS command-line port — used only for Qobuz catalogue search. |
LMS_USER |
(empty) | LMS username — only if you password-protected LMS. |
LMS_PASS |
(empty) | LMS password — only if you password-protected LMS. |
LRA_DEBUG |
(unset) | Set to 1 for verbose logging. |
Once it’s running, open http://<the-machine's-address>:<PORT> in a browser.
Linux
1. Install Node.js 18+
Debian / Ubuntu / DietPi / Raspberry Pi OS (via NodeSource, which ships current versions):
curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash -
sudo apt-get install -y nodejs
Fedora / RHEL:
sudo dnf install -y nodejs
Or, on any distro, with nvm:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash
nvm install --lts
Check it: node --version (should be v18 or higher).
2. Get the code and install the dependency
git clone https://github.com/<your-user>/lms-random-albums.git
cd lms-random-albums
npm install
(No git? Download the ZIP from the GitHub “Code” button, extract it, and cd into the folder.)
3. Run it
LMS_HOST=192.168.1.50 PORT=3390 node index.js
Replace 192.168.1.50 with your LMS box’s address (omit LMS_HOST if LMS is on this same machine). Then open http://localhost:3390 (or http://<this-machine-ip>:3390 from another device).
4. (Recommended) Run automatically on boot with systemd
Create /etc/systemd/system/lms-random-albums.service:
[Unit]
Description=LMS Random Albums
After=network-online.target
Wants=network-online.target
[Service]
Type=simple
WorkingDirectory=/opt/lms-random-albums
ExecStart=/usr/bin/node /opt/lms-random-albums/index.js
Environment=PORT=3390
Environment=LMS_HOST=127.0.0.1
Environment=LMS_PORT=9000
Restart=on-failure
RestartSec=5
[Install]
WantedBy=multi-user.target
Adjust WorkingDirectory/ExecStart to where you put the project, and the path to node (find it with which node — on some systems it’s /usr/local/bin/node). Then:
sudo systemctl daemon-reload
sudo systemctl enable --now lms-random-albums
sudo systemctl status lms-random-albums # check it's running
sudo journalctl -u lms-random-albums -f # follow the logs
To deploy an update later: copy the new files over, then sudo systemctl restart lms-random-albums.
macOS
1. Install Node.js 18+
With Homebrew:
brew install node
…or download the macOS installer from nodejs.org. Verify with node --version.
2. Get the code and install the dependency
git clone https://github.com/<your-user>/lms-random-albums.git
cd lms-random-albums
npm install
3. Run it
LMS_HOST=192.168.1.50 PORT=3390 node index.js
Open http://localhost:3390. (If LMS runs on this same Mac, you can drop LMS_HOST.)
4. (Recommended) Run automatically on login with launchd
Create ~/Library/LaunchAgents/com.lmsrandomalbums.plist (adjust the two paths to match your install and the output of which node):
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.lmsrandomalbums</string>
<key>ProgramArguments</key>
<array>
<string>/opt/homebrew/bin/node</string>
<string>/Users/you/lms-random-albums/index.js</string>
</array>
<key>EnvironmentVariables</key>
<dict>
<key>PORT</key><string>3390</string>
<key>LMS_HOST</key><string>127.0.0.1</string>
<key>LMS_PORT</key><string>9000</string>
</dict>
<key>WorkingDirectory</key>
<string>/Users/you/lms-random-albums</string>
<key>RunAtLoad</key><true/>
<key>KeepAlive</key><true/>
</dict>
</plist>
Then load it:
launchctl load ~/Library/LaunchAgents/com.lmsrandomalbums.plist
(launchctl unload … to stop it.)
Windows
1. Install Node.js 18+
Download the LTS installer from nodejs.org and run it, or use winget:
winget install OpenJS.NodeJS.LTS
Open a new PowerShell window and verify: node --version.
2. Get the code and install the dependency
With Git:
git clone https://github.com/<your-user>/lms-random-albums.git
cd lms-random-albums
npm install
No Git? Use the green Code → Download ZIP button on GitHub, extract it (e.g. to C:\lms-random-albums), open PowerShell in that folder, and run npm install.
3. Run it
In PowerShell:
$env:LMS_HOST="192.168.1.50"; $env:PORT="3390"; node index.js
…or in Command Prompt (cmd):
set LMS_HOST=192.168.1.50 && set PORT=3390 && node index.js
Then open http://localhost:3390. (Drop LMS_HOST if LMS is on this same PC.)
4. (Recommended) Run automatically as a Windows service
The simplest route is NSSM (the Non-Sucking Service Manager). Download it, then from an Administrator prompt (adjust the paths):
nssm install LmsRandomAlbums "C:\Program Files\nodejs\node.exe" "C:\lms-random-albums\index.js"
nssm set LmsRandomAlbums AppDirectory "C:\lms-random-albums"
nssm set LmsRandomAlbums AppEnvironmentExtra LMS_HOST=192.168.1.50 LMS_PORT=9000 PORT=3390
nssm start LmsRandomAlbums
It will now start on boot. Manage it with nssm restart LmsRandomAlbums / nssm stop LmsRandomAlbums, or via services.msc.
Prefer no extra tools? You can instead create a Task Scheduler task set to “Run whether user is logged on or not,” triggered “At startup,” with action Start a program →
node.exe, argumentsC:\lms-random-albums\index.js, and the environment variables baked into a small.batwrapper that the task runs.
Install it on your phone (PWA)
- Open
http://<the-machine-ip>:<PORT>in your phone’s browser (same Wi-Fi as the server). - iOS / Safari: tap the Share button → Add to Home Screen.
Android / Chrome: menu → Install app / Add to Home screen. - Launch it from the home-screen icon — it runs full-screen, no browser chrome.
A network-first service worker keeps the installed app up to date: each launch fetches the latest version, so future updates appear automatically.
Using Qobuz catalogue search
If the Qobuz plugin is installed and the LMS CLI is enabled (port 9090), the search box also queries the Qobuz online catalogue:
- Catalogue albums appear below your local results under a “From Qobuz” heading, each marked with a small Qobuz badge.
- Open one to see its tracks and the usual Play Now / Add to Queue / Play Next / Shuffle buttons.
- Tap the heart (top of the album view) to add or remove it from your Qobuz favourites. Outline = not a favourite, filled = already a favourite. Albums you favourite get scanned into your LMS library, after which they also show up as normal local results.
This works by driving the Qobuz plugin’s own browse/favourite path through the LMS CLI (the plugin resolves its menus asynchronously, which the CLI handles correctly), so it behaves just like favouriting from the plugin’s own interface. If the CLI is off or the plugin isn’t installed, this section is simply skipped and the rest of the app is unaffected.
How it works
Random Albums is a small Express server that proxies between your browser and LMS:
- Library, art, playback, queue, players → LMS JSON-RPC at
http://LMS_HOST:LMS_PORT/jsonrpc.js. - Qobuz catalogue (search, drill, play, favourite) → the LMS CLI at
LMS_HOST:LMS_CLI_PORT, with commands issued sequentially per connection so the plugin’s async menus resolve correctly. - Album art is proxied through the app; a paginated, cached in-memory index keeps search fast on large libraries.
Nothing is written to LMS’s configuration and no plugin is installed, so adding or removing the app has no effect on your server.
Troubleshooting
- The wall is empty / “is your library indexed?” — Check that
LMS_HOST/LMS_PORTpoint at a reachable LMS and that your library has finished scanning. WithLRA_DEBUG=1the logs show what it’s asking LMS for. - Can’t reach it from my phone — Use the server machine’s LAN IP (not
localhost), make sure both devices are on the same network, and allow the chosenPORTthrough any firewall. - “From Qobuz” results never appear — Confirm the Qobuz plugin is installed and working in LMS, and that the CLI is enabled on port 9090 (set
LMS_CLI_PORTif you changed it). If Qobuz has been hammered with rapid searches it can briefly go quiet — restarting LMS clears it. - Port already in use — Set a different
PORT. - The installed PWA shows old code — Launch it once while on the network so the service worker can fetch the latest version; if it was installed before the service worker existed, remove it from the home screen, reload the page in the browser, and re-add it.
Credits & notes
Random Albums began life as a Roon extension; this is a port to Lyrion Music Server with the backend rewritten to speak LMS’s JSON-RPC and CLI interfaces. The web UI is otherwise the same idea.
Not affiliated with or endorsed by Lyrion / the Squeezebox project or Qobuz. “Lyrion Music Server,” “Squeezebox,” and “Qobuz” are trademarks of their respective owners.
License
MIT License
Enjoy.