Koito/internal/repository/models.go
Gabe Farrell 36f984a1a2
Pre-release version v0.0.14 (#96)
* add dev branch container to workflow

* correctly set the default range of ActivityGrid

* fix: set name/short_name to koito (#61)

* fix dev container push workflow

* fix: race condition with using getComputedStyle primary color for dynamic activity grid darkening (#76)

* Fix race condition with using getComputedStyle primary color for dynamic activity grid darkening

Instead just use the color from the current theme directly. Tested works on initial load and theme changes.
Fixes https://github.com/gabehf/Koito/issues/75

* Rework theme provider to provide the actual Theme object throughtout the app, in addition to the name
Split name out of the Theme struct to simplify custom theme saving/reading

* fix: set first artist listed as primary by default (#81)

* feat: add server-side configuration with default theme (#90)

* docs: add example for usage of the main listenbrainz instance (#71)

* docs: add example for usage of the main listenbrainz instance

* Update scrobbler.md

---------

Co-authored-by: Gabe Farrell <90876006+gabehf@users.noreply.github.com>

* feat: add server-side cfg and default theme

* fix: repair custom theme

---------

Co-authored-by: m0d3rnX <jesper@posteo.de>

* docs: add default theme cfg option to docs

* feat: add ability to manually scrobble track (#91)

* feat: add button to manually scrobble from ui

* fix: ensure timestamp is in the past, log fix

* test: add integration test

* feat: add first listened to dates for media items (#92)

* fix: ensure error checks for ErrNoRows

* feat: add now playing endpoint and ui (#93)

* wip

* feat: add now playing

* fix: set default theme when config is not set

* feat: fetch images from subsonic server (#94)

* fix: useQuery instead of useEffect for now playing

* feat: custom artist separator regex (#95)

* Fix race condition with using getComputedStyle primary color for dynamic activity grid darkening

Instead just use the color from the current theme directly. Tested works on initial load and theme changes.
Fixes https://github.com/gabehf/Koito/issues/75

* Rework theme provider to provide the actual Theme object throughtout the app, in addition to the name
Split name out of the Theme struct to simplify custom theme saving/reading

* feat: add server-side configuration with default theme (#90)

* docs: add example for usage of the main listenbrainz instance (#71)

* docs: add example for usage of the main listenbrainz instance

* Update scrobbler.md

---------

Co-authored-by: Gabe Farrell <90876006+gabehf@users.noreply.github.com>

* feat: add server-side cfg and default theme

* fix: repair custom theme

---------

Co-authored-by: m0d3rnX <jesper@posteo.de>

* fix: rebase errors

---------

Co-authored-by: pet <128837728+againstpetra@users.noreply.github.com>
Co-authored-by: mlandry <mike.landry@gmail.com>
Co-authored-by: m0d3rnX <jesper@posteo.de>
2025-11-19 20:26:56 -05:00

166 lines
2.7 KiB
Go

// Code generated by sqlc. DO NOT EDIT.
// versions:
// sqlc v1.30.0
package repository
import (
"database/sql/driver"
"fmt"
"time"
"github.com/google/uuid"
"github.com/jackc/pgx/v5/pgtype"
)
type Role string
const (
RoleAdmin Role = "admin"
RoleUser Role = "user"
)
func (e *Role) Scan(src interface{}) error {
switch s := src.(type) {
case []byte:
*e = Role(s)
case string:
*e = Role(s)
default:
return fmt.Errorf("unsupported scan type for Role: %T", src)
}
return nil
}
type NullRole struct {
Role Role
Valid bool // Valid is true if Role is not NULL
}
// Scan implements the Scanner interface.
func (ns *NullRole) Scan(value interface{}) error {
if value == nil {
ns.Role, ns.Valid = "", false
return nil
}
ns.Valid = true
return ns.Role.Scan(value)
}
// Value implements the driver Valuer interface.
func (ns NullRole) Value() (driver.Value, error) {
if !ns.Valid {
return nil, nil
}
return string(ns.Role), nil
}
type ApiKey struct {
ID int32
Key string
UserID int32
CreatedAt pgtype.Timestamp
Label string
}
type Artist struct {
ID int32
MusicBrainzID *uuid.UUID
Image *uuid.UUID
ImageSource pgtype.Text
}
type ArtistAlias struct {
ArtistID int32
Alias string
Source string
IsPrimary bool
}
type ArtistRelease struct {
ArtistID int32
ReleaseID int32
IsPrimary bool
}
type ArtistTrack struct {
ArtistID int32
TrackID int32
IsPrimary bool
}
type ArtistsWithName struct {
ID int32
MusicBrainzID *uuid.UUID
Image *uuid.UUID
ImageSource pgtype.Text
Name string
}
type Listen struct {
TrackID int32
ListenedAt time.Time
Client *string
UserID int32
}
type Release struct {
ID int32
MusicBrainzID *uuid.UUID
Image *uuid.UUID
VariousArtists bool
ImageSource pgtype.Text
}
type ReleaseAlias struct {
ReleaseID int32
Alias string
Source string
IsPrimary bool
}
type ReleasesWithTitle struct {
ID int32
MusicBrainzID *uuid.UUID
Image *uuid.UUID
VariousArtists bool
ImageSource pgtype.Text
Title string
}
type Session struct {
ID uuid.UUID
UserID int32
CreatedAt time.Time
ExpiresAt time.Time
Persistent bool
}
type Track struct {
ID int32
MusicBrainzID *uuid.UUID
Duration int32
ReleaseID int32
}
type TrackAlias struct {
TrackID int32
Alias string
IsPrimary bool
Source string
}
type TracksWithTitle struct {
ID int32
MusicBrainzID *uuid.UUID
Duration int32
ReleaseID int32
Title string
}
type User struct {
ID int32
Username string
Role Role
Password []byte
}