Koito/internal/db/types.go
Gabe Farrell 231eb1b0fb
feat: interest over time graph (#127)
* api

* ui

* test

* add margin to prevent clipping
2026-01-12 16:20:31 -05:00

52 lines
1.3 KiB
Go

package db
import (
"time"
"github.com/gabehf/koito/internal/models"
"github.com/google/uuid"
)
type InformationSource string
const (
InformationSourceInferred InformationSource = "Inferred"
InformationSourceMusicBrainz InformationSource = "MusicBrainz"
InformationSourceUserProvided InformationSource = "User"
)
type ListenActivityItem struct {
Start time.Time `json:"start_time"`
Listens int64 `json:"listens"`
}
type PaginatedResponse[T any] struct {
Items []T `json:"items"`
TotalCount int64 `json:"total_record_count"`
ItemsPerPage int32 `json:"items_per_page"`
HasNextPage bool `json:"has_next_page"`
CurrentPage int32 `json:"current_page"`
}
type ExportItem struct {
ListenedAt time.Time
UserID int32
Client *string
TrackID int32
TrackMbid *uuid.UUID
TrackDuration int32
TrackAliases []models.Alias
ReleaseID int32
ReleaseMbid *uuid.UUID
ReleaseImage *uuid.UUID
ReleaseImageSource string
VariousArtists bool
ReleaseAliases []models.Alias
Artists []models.ArtistWithFullAliases
}
type InterestBucket struct {
BucketStart time.Time `json:"bucket_start"`
BucketEnd time.Time `json:"bucket_end"`
ListenCount int64 `json:"listen_count"`
}