sonda/sonda.example.toml
tgiachi 7bdbc9e160 fix(images): limit parallel builds, no stale saves, safer files
- At most two covers are built at the same time: a page of albums asked for at once
  could decode dozens of large pictures together.
- A change to an album's files marks its record stale and moves a generation instead
  of deleting the row. A build that started before the change is not saved over it
  and starts again, so a "no cover" found too early cannot win for a day.
- A cover that was found is checked again after a week, so a picture replaced in a
  folder is noticed.
- For CD1/Disc 2 folders the picture in the folder above is used. Folder pictures
  are read one at a time, and the pixel count is computed in 64 bits.
- Stored files are synced before they get their name, an empty one counts as
  missing, and old temporary files from a crash are removed.
- Files without track or disc numbers sort the same on both databases.
- storage.data_dir defaults next to the SQLite database, so a service started from
  another folder does not need a writable working directory.
- Tests: a listener who leaves, a change during a build, the build limit, a named
  pipe, an embedded picture of a file outside the library that exists, builds that
  really overlap.
2026-11-11 21:03:26 +01:00

42 lines
1.7 KiB
TOML

# Copy to sonda.toml and adjust. sonda.toml is git-ignored.
# Precedence: defaults < this file < environment variables
# (SONDA_ENV, SONDA_LISTEN, SONDA_DB_DRIVER, SONDA_DB_PATH, SONDA_DB_DSN,
# SONDA_JWT_SECRET).
[server]
listen = "127.0.0.1:8080" # localhost by default
# Libraries (name + directory) are managed through the API: POST /api/v1/libraries.
[library]
scan_workers = 4 # parallel tag readers during a scan
[database]
driver = "sqlite" # "sqlite" or "postgres"
path = "sonda.db" # sqlite only
dsn = "" # postgres only, e.g. "postgres://user:pass@localhost:5432/sonda?sslmode=disable"
[log]
env = "production" # "dev" or "production"
[auth]
jwt_secret = "" # required, 32+ chars: openssl rand -hex 32
access_ttl_minutes = 15 # lifetime of an access token
refresh_ttl_hours = 720 # lifetime of a refresh token (30 days)
[listening]
min_listen_seconds = 20 # a play counts as a listen after this long, or when it completes
[taste]
half_life_days = 90 # an old listen weighs half as much after this many days
[storage]
# data_dir = "data" # files Sonda makes (covers); built from your music, no backup needed.
# Default: "data" next to the SQLite database.
[scoring] # weights of the parts of a Discover score (only their proportions matter)
weight_affinity = 0.40 # similar to the artists I like
weight_genre = 0.25 # tags close to the tags I like
weight_preference = 0.25 # what my listening says about the artist
weight_discovery = 0.10 # bonus for what I have not played yet
# Last.fm and MusicBrainz are set up through the API, not here: PUT /api/v1/providers/{name}.