feat(admin): switches for ListenBrainz similarity and MusicBrainz track lists
release / go (push) Successful in 1m50s
release / web (push) Successful in 1m15s
release / govulncheck (push) Successful in 20s
release / integration (push) Successful in 4m11s
release / android (push) Successful in 4m33s
release / Build signed APK (push) Successful in 4m40s
release / Attach APK to the Release (tag releases only) (push) Skipped
release / Build + push container image (push) Successful in 22s
release / Verify release artifacts (tag releases only) (push) Skipped
release / go (push) Successful in 1m50s
release / web (push) Successful in 1m15s
release / govulncheck (push) Successful in 20s
release / integration (push) Successful in 4m11s
release / android (push) Successful in 4m33s
release / Build signed APK (push) Successful in 4m40s
release / Attach APK to the Release (tag releases only) (push) Skipped
release / Build + push container image (push) Successful in 22s
release / Verify release artifacts (tag releases only) (push) Skipped
Both lookups ran with no way to stop them. Admin › Metadata sources now has an "Other lookups" group with a switch each, both on by default (lookup_settings, migration 0111). Off, the similarity worker asks ListenBrainz nothing and still links what it already fetched; the duplicate resolver gets ErrLookupOff and decides from the track lists it already has. The setting is backed up, and docs/security.md names the switches. docs/security.md also says every account but the first needs an invite. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,52 @@
|
||||
// Code generated by sqlc. DO NOT EDIT.
|
||||
// versions:
|
||||
// sqlc v1.31.1
|
||||
// source: lookup_settings.sql
|
||||
|
||||
package dbq
|
||||
|
||||
import (
|
||||
"context"
|
||||
)
|
||||
|
||||
const getLookupSettings = `-- name: GetLookupSettings :one
|
||||
SELECT id, listenbrainz_similarity, musicbrainz_track_lists, updated_at FROM lookup_settings WHERE id = true
|
||||
`
|
||||
|
||||
func (q *Queries) GetLookupSettings(ctx context.Context) (LookupSetting, error) {
|
||||
row := q.db.QueryRow(ctx, getLookupSettings)
|
||||
var i LookupSetting
|
||||
err := row.Scan(
|
||||
&i.ID,
|
||||
&i.ListenbrainzSimilarity,
|
||||
&i.MusicbrainzTrackLists,
|
||||
&i.UpdatedAt,
|
||||
)
|
||||
return i, err
|
||||
}
|
||||
|
||||
const updateLookupSettings = `-- name: UpdateLookupSettings :one
|
||||
UPDATE lookup_settings
|
||||
SET listenbrainz_similarity = $1,
|
||||
musicbrainz_track_lists = $2,
|
||||
updated_at = now()
|
||||
WHERE id = true
|
||||
RETURNING id, listenbrainz_similarity, musicbrainz_track_lists, updated_at
|
||||
`
|
||||
|
||||
type UpdateLookupSettingsParams struct {
|
||||
ListenbrainzSimilarity bool
|
||||
MusicbrainzTrackLists bool
|
||||
}
|
||||
|
||||
func (q *Queries) UpdateLookupSettings(ctx context.Context, arg UpdateLookupSettingsParams) (LookupSetting, error) {
|
||||
row := q.db.QueryRow(ctx, updateLookupSettings, arg.ListenbrainzSimilarity, arg.MusicbrainzTrackLists)
|
||||
var i LookupSetting
|
||||
err := row.Scan(
|
||||
&i.ID,
|
||||
&i.ListenbrainzSimilarity,
|
||||
&i.MusicbrainzTrackLists,
|
||||
&i.UpdatedAt,
|
||||
)
|
||||
return i, err
|
||||
}
|
||||
@@ -328,6 +328,13 @@ type ListenbrainzSimilarRecording struct {
|
||||
Score float64
|
||||
}
|
||||
|
||||
type LookupSetting struct {
|
||||
ID bool
|
||||
ListenbrainzSimilarity bool
|
||||
MusicbrainzTrackLists bool
|
||||
UpdatedAt pgtype.Timestamptz
|
||||
}
|
||||
|
||||
type LoudnessSetting struct {
|
||||
ID bool
|
||||
Enabled bool
|
||||
@@ -515,11 +522,6 @@ type RecommendationWeightProfile struct {
|
||||
ContextTimeWeight float64
|
||||
}
|
||||
|
||||
type RegistrationSetting struct {
|
||||
ID bool
|
||||
Mode string
|
||||
}
|
||||
|
||||
type ScanRun struct {
|
||||
ID pgtype.UUID
|
||||
StartedAt pgtype.Timestamptz
|
||||
|
||||
Reference in New Issue
Block a user