Every 15 minutes (library.auto_scan_minutes, SONDA_AUTO_SCAN_MINUTES, 0 turns it off) Sonda takes the signature of each library, a hash of the names of everything in it folder by folder, which costs only the names of the files and so suits a NAS that sleeps. A library whose signature changed (a song or a folder came, went or was renamed) is scanned the usual way; every library is also scanned at least once a day, to find a song tagged again where it stands. It does not scan while another scan runs, tries again at the next look when a scan failed, leaves alone a folder that cannot be read (a NAS that is not mounted), and ignores the housekeeping folders of a NAS.
51 lines
2.4 KiB
TOML
51 lines
2.4 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
|
|
auto_scan_minutes = 15 # how often to look at the folders and scan the libraries whose music changed
|
|
# (0 turns it off). Looking reads the names of the files, nothing else, so it is
|
|
# cheap for a NAS; a library is scanned at least once a day. Or SONDA_AUTO_SCAN_MINUTES.
|
|
# allow_delete = true # let an admin delete the extra copy of a song from the music folders.
|
|
# Off by default: it is the one thing that makes Sonda write there, and it
|
|
# needs the folders mounted writable. Or set SONDA_ALLOW_DELETE=true.
|
|
|
|
[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.
|
|
|
|
[wikipedia]
|
|
languages = ["it", "en"] # descriptions of artists: the first language that has a page wins
|
|
|
|
[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}.
|