mirror of
https://github.com/riwiwa/muzi.git
synced 2026-02-28 11:56:57 -08:00
add scrobbling through listenbrainz-like endpoint and lastfm-like endpoint
This commit is contained in:
12
db/db.go
12
db/db.go
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user