Alternative names (#32): - PUT /api/v1/soundtracks/{uuid}/alternative-names replaces a soundtrack's alternative names (trimmed, deduplicated, without the soundtrack's own name). - alternative_names is in the soundtrack and statistics responses. - /find matches them too and shows which name matched. Covers (#12), stored in COVERS_PATH and off when it is not set: - GET, PUT (upload) and DELETE /api/v1/soundtracks/{uuid}/cover, and PUT .../cover/source to pick a SteamGridDB game or AniList anime by ID. Uploaded and picked covers are never replaced automatically. - With STEAMGRIDDB_API_KEY, a background job searches SteamGridDB, then AniList, by name, alternative names and the name without bracketed parts, at startup, after a sync and after names change. Search results are ranked by matching words, so "Civilization IV" gets "Sid Meier's Civilization IV". - cover_modified (Unix seconds) is in the soundtrack and statistics responses, so clients can cache covers. The new columns are added to migration 000006, which is not released yet. Closes #12, closes #32 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
90 lines
3.2 KiB
Go
90 lines
3.2 KiB
Go
// Code generated by sqlc. DO NOT EDIT.
|
|
// versions:
|
|
// sqlc v1.31.1
|
|
|
|
package repository
|
|
|
|
import (
|
|
"time"
|
|
|
|
"github.com/google/uuid"
|
|
"github.com/jackc/pgx/v5/pgtype"
|
|
)
|
|
|
|
type Queue struct {
|
|
Uuid uuid.UUID `json:"uuid"`
|
|
CurrentSong int32 `json:"current_song"`
|
|
LastFetchedSongUuid uuid.UUID `json:"last_fetched_song_uuid"`
|
|
LastFetchedMode *string `json:"last_fetched_mode"`
|
|
StartedAt pgtype.Timestamptz `json:"started_at"`
|
|
EndedAt pgtype.Timestamptz `json:"ended_at"`
|
|
}
|
|
|
|
type QueueSong struct {
|
|
QueueUuid uuid.UUID `json:"queue_uuid"`
|
|
SongNo int32 `json:"song_no"`
|
|
SongUuid uuid.UUID `json:"song_uuid"`
|
|
SoundtrackName string `json:"soundtrack_name"`
|
|
SongName string `json:"song_name"`
|
|
Mode string `json:"mode"`
|
|
AddedAt pgtype.Timestamptz `json:"added_at"`
|
|
}
|
|
|
|
type Session struct {
|
|
Token string `json:"token"`
|
|
IpAddress string `json:"ip_address"`
|
|
UserAgent string `json:"user_agent"`
|
|
ClientType *string `json:"client_type"`
|
|
ExpiresAt pgtype.Timestamptz `json:"expires_at"`
|
|
CreatedAt pgtype.Timestamptz `json:"created_at"`
|
|
}
|
|
|
|
type Song struct {
|
|
SoundtrackID int32 `json:"soundtrack_id"`
|
|
SongName string `json:"song_name"`
|
|
Path string `json:"path"`
|
|
TimesPlayed int32 `json:"times_played"`
|
|
Hash string `json:"hash"`
|
|
FileName *string `json:"file_name"`
|
|
Uuid uuid.UUID `json:"uuid"`
|
|
SoundtrackUuid uuid.UUID `json:"soundtrack_uuid"`
|
|
}
|
|
|
|
type SongList struct {
|
|
MatchDate time.Time `json:"match_date"`
|
|
MatchID int32 `json:"match_id"`
|
|
SongNo int32 `json:"song_no"`
|
|
SoundtrackName *string `json:"soundtrack_name"`
|
|
SongName *string `json:"song_name"`
|
|
}
|
|
|
|
type Soundtrack struct {
|
|
ID int32 `json:"id"`
|
|
SoundtrackName string `json:"soundtrack_name"`
|
|
Added time.Time `json:"added"`
|
|
Deleted *time.Time `json:"deleted"`
|
|
LastChanged *time.Time `json:"last_changed"`
|
|
Path string `json:"path"`
|
|
TimesPlayed int32 `json:"times_played"`
|
|
LastPlayed *time.Time `json:"last_played"`
|
|
NumberOfSongs int32 `json:"number_of_songs"`
|
|
Hash string `json:"hash"`
|
|
Uuid uuid.UUID `json:"uuid"`
|
|
Fingerprint string `json:"fingerprint"`
|
|
AlternativeNames []string `json:"alternative_names"`
|
|
CoverFile *string `json:"cover_file"`
|
|
CoverSource *string `json:"cover_source"`
|
|
CoverExternalID *string `json:"cover_external_id"`
|
|
CoverManual bool `json:"cover_manual"`
|
|
CoverModified pgtype.Timestamptz `json:"cover_modified"`
|
|
CoverChecked pgtype.Timestamptz `json:"cover_checked"`
|
|
}
|
|
|
|
type Vgmq struct {
|
|
SongNo int32 `json:"song_no"`
|
|
Path *string `json:"path"`
|
|
Clue *string `json:"clue"`
|
|
Answered bool `json:"answered"`
|
|
Answer *string `json:"answer"`
|
|
}
|