feat(settings): my own settings, starting with Discover from my listening

- GET and PATCH /me/settings: settings that belong to the signed-in user.
- First setting, discover_from_listening, is off by default. When on, Discover
  may start from the artists I listen to most, which sends their names to
  Last.fm.
- New user_settings table (migration 0011, SQLite and PostgreSQL), removed with
  the account. A user with no row has the private defaults.
- A misspelt setting is rejected instead of being ignored.
- Spec, contract test and README updated.

Refs #29
This commit is contained in:
tgiachi 2026-11-11 19:16:26 +01:00
commit e0592c0260

View file

@ -28,6 +28,7 @@ import (
"codeberg.org/squidd/sonda/internal/storage"
"codeberg.org/squidd/sonda/internal/streaming"
"codeberg.org/squidd/sonda/internal/taste"
"codeberg.org/squidd/sonda/internal/usersettings"
"codeberg.org/squidd/sonda/migrations"
)
@ -150,6 +151,7 @@ func run() error {
Discovery: discoveries,
Tags: tags,
Taste: taste.NewService(storage.NewTasteRepo(db), taste.Options{MinListen: cfg.Listening.MinListen(), HalfLife: cfg.Taste.HalfLife()}),
Settings: usersettings.NewService(storage.NewUserSettingsRepo(db)),
Streams: streaming.NewService(libraryRepo),
})