Skip to content

Tag and enrich your library

This guide describes how to maintain your library with the toolkit - the Python scripts that ship inside the server repository, under scripts/; the Library toolkit reference is the script-by-script map, this guide is the flow.

The toolkit reads your music files and writes the results where the server can find them. If you have not scanned yet, start with Add your music; the toolkit needs Python 3.12 or newer and its dependencies from scripts/requirements.txt.

Run the scripts from the root of the server repository, where config.toml lives - they read that file, and unlike the server binary they do not search parent folders for it.

The tools cover ingest end to end:

Script What the audited source documents it for
scan_library.py Scans your music folder into data.db
tagger.py Enriches file metadata using MusicBrainz and Cover Art Archive
tagger_ai.py AI-assisted tagging using Discogs
genres.py Genre tagging using Discogs and the shipped genre dictionary
lyrics.py Fetches lyrics for tracks
user_tools.py, db_tools.py Utility scripts (see below)
autopipeline.py Orchestrates the enrichment pass

autopipeline.py is an all-in-one enrichment; runs scanning, tagging, genre tagging, lyrics downloads and other tools:

Terminal window
python scripts/autopipeline.py

scan_library.py takes a --mode argument, and the source names three modes: db, quick and reviewaq.

The Getting started guide uses --mode db, which is the default mode.

tagger.py enriches your files’ metadata using two public services, called over HTTPS and with no credentials required:

  • MusicBrainz for metadata.
  • Cover Art Archive for artwork.

tagger_ai.py and parts of genres.py query Discogs. To use them you need Discogs consumer credentials, configured in the server’s config.toml under [auth]:

[auth]
discogs_consumer_key = "..."
discogs_consumer_secret = "..."

How you obtain those keys from Discogs is outside the audited source; check Discogs’ own documentation.

genres.py maps what it finds onto a controlled vocabulary rather than free text: a dictionary shipped in the server repository under dict/ (audioland_dict.json and its base/). Genres in your library therefore come from that list.

lyrics.py fetches lyrics for your tracks. Once a track has a lyrics file, the desktop player can display it - synced (LRC) or plain text, as described in Play and browse your library.

  • user_tools.py - user management; it is the toolkit’s documented path for creating your first account (see Create your account).
  • db_tools.py - a database helper. The audited source lists it without documenting its detailed behavior, so treat it as a maintenance tool to inspect before relying on.

Two things connect the toolkit to the server, and they set your expectations for when changes show up:

  1. The toolkit writes the same data.db the server reads - there is no second database and no service between them.
  2. When files on disk change, run a scan again (python scripts/scan_library.py --mode db) before you expect the server to show new tags, lyrics or genres. No automatic re-indexing is documented anywhere in the audited source.

If you added files or ran the pipeline and the server still shows nothing new, start with Troubleshooting.