add scrobbling through listenbrainz-like endpoint and lastfm-like endpoint

This commit is contained in:
2026-02-27 23:27:02 -08:00
parent 90121b4fd1
commit 9979456719
10 changed files with 1452 additions and 9 deletions

View File

@@ -88,7 +88,6 @@ func CreateHistoryTable() error {
return nil
}
// TODO: move user settings to jsonb in db
func CreateUsersTable() error {
_, err := Pool.Exec(context.Background(),
`CREATE TABLE IF NOT EXISTS users (
@@ -97,8 +96,17 @@ func CreateUsersTable() error {
bio TEXT DEFAULT 'This profile has no bio.',
pfp TEXT DEFAULT '/files/assets/pfps/default.png',
allow_duplicate_edits BOOLEAN DEFAULT FALSE,
api_key TEXT,
api_secret TEXT,
spotify_client_id TEXT,
spotify_client_secret TEXT,
spotify_access_token TEXT,
spotify_refresh_token TEXT,
spotify_token_expires TIMESTAMPTZ,
last_spotify_check TIMESTAMPTZ,
pk SERIAL PRIMARY KEY
);`)
);
CREATE INDEX IF NOT EXISTS idx_users_api_key ON users(api_key);`)
if err != nil {
fmt.Fprintf(os.Stderr, "Error creating users table: %v\n", err)
return err