Documentation
¶
Index ¶
- Constants
- Variables
- func DecodeEventData[T any](evt SSEvent) (T, error)
- type Action
- type Album
- type AlbumArtist
- type AlbumBase
- type AlbumDetailed
- type AlbumTrack
- type AlbumUpdate
- type Artist
- type ArtistBase
- type ArtistDetailed
- type ArtistMinimal
- type ArtistRole
- type AudioFile
- type AuthIdentity
- type AuthProvider
- type ClientConfig
- type ClientEvent
- type ClientMessage
- type Codec
- type ColorScheme
- type CreateUserApiTokenReq
- type CreateUserApiTokenResp
- type CreateUserReq
- type DBSyncState
- type Device
- type DeviceBase
- type DeviceDetailed
- type DeviceIcon
- type DeviceInterface
- type DeviceToken
- type DeviceType
- type EntityEvent
- type EntityEventType
- type EntityEvents
- type EntityType
- type FilterMood
- type FilterUpperLower
- type Healthz
- type HealthzStatus
- type HexColor
- type Import
- type ImportAlbum
- type ImportState
- type ImportType
- type JobType
- type Like
- type ListPaginationPayload
- type ListPayload
- type LocalCredentials
- type LoginReq
- type LoginResp
- type MediaFile
- type MediaStream
- type NoResponse
- type PlayContext
- type PlayContextDTO
- type PlayContextOld
- type PlayContextType
- type PlayHistory
- type PlayHistorySyncState
- type PlaybackState
- type PlaybackStateDTO
- type PlayerState
- type PlayerStateDTO
- type Playlist
- type PlaylistBase
- type PlaylistTrack
- type PlaylistTrackReq
- type PlaylistType
- type Rating
- type RatingReq
- type RepeatType
- type ReqDevicesRegister
- type ReqPlaylistsAdd
- type RespDevicesRegister
- type Response
- type SSENoData
- type SSEvent
- func SSEDeviceConnected(d Device) SSEvent
- func SSEDeviceDeleted(id uuid.UUID) SSEvent
- func SSEDeviceDisconnected(d Device) SSEvent
- func SSEDevicePlayContext(pc PlayContextDTO) SSEvent
- func SSEDevicePlaybackState(ps PlaybackStateDTO) SSEvent
- func SSEDeviceUpdated(d Device) SSEvent
- func SSEImporterItemsUpdated() SSEvent
- func SSEPlayerAddToQueue(t TrackDetailed) SSEvent
- func SSEPlayerNextTrack() SSEvent
- func SSEPlayerPlayContext(pc PlayContextDTO) SSEvent
- func SSEPlayerPlayPause() SSEvent
- func SSEPlayerPlaybackState(ps PlaybackStateDTO) SSEvent
- func SSEPlayerPreviousTrack() SSEvent
- func SSEPlayerSetRepeat(rt RepeatType) SSEvent
- func SSEPlayerSetShuffle(a bool) SSEvent
- func SSEPlayerSetState(pc PlayerState) SSEvent
- func SSEPlayerStop() SSEvent
- func SSEServerMessage(level SSEventMsgLevel, title, body string) SSEvent
- type SSEventMsgLevel
- type SSEventMsgPayload
- type SSEventType
- type SearchItem
- type ServerApiInfo
- type ServerInfo
- type SetDevicePlayerRepeatReq
- type SetDevicePlayerShuffleReq
- type SmartPlaylist
- type SmartPlaylistArtist
- type SmartPlaylistContent
- type SyncData
- type SyncItem
- type SyncItemState
- type SyncItemType
- type SyncPlayHistoryReq
- type SyncReq
- type SyncState
- type Theme
- type ThemeColors
- type ThemeDescription
- type Token
- type TokenLimited
- type TokenType
- type Track
- type TrackAnalysis
- type TrackAnalysisResults
- type TrackArtist
- type TrackDetailed
- type TrackDetailedNew
- type TrackFilter
- type TrackSource
- type TrackUpdate
- type UpdateProfileReq
- type UpdateUserReq
- type User
- type UserDetails
- type UserRole
- type UserScope
Constants ¶
View Source
const ( UserRoleAdmin UserRole = "admin" UserRoleRead UserRole = "read" UserRoleWrite UserRole = "write" UserRoleImporterRead UserRole = "importer:read" UserRoleImporterWrite UserRole = "importer:write" UserRoleUsersRead UserRole = "users:read" UserRoleUsersCreate UserRole = "users:create" UserRoleUsersUpdate UserRole = "users:update" UserRoleUsersDelete UserRole = "users:delete" AuthLocal AuthProvider = "local" TokenFrontendLong TokenType = "frontend_long" TokenFrontendShort TokenType = "frontend_short" TokenAPI TokenType = "api" )
View Source
const ( DeviceTypeStreaming DeviceType = "streaming" DeviceTypeSync DeviceType = "sync" DeviceInterfaceDaemon DeviceInterface = "daemon" DeviceInterfaceDesktop DeviceInterface = "desktop" DeviceInterfaceTerminal DeviceInterface = "terminal" DeviceInterfaceWeb DeviceInterface = "web" DeviceIconLaptop DeviceIcon = "laptop" DeviceIconComputer DeviceIcon = "computer" DeviceIconPhone DeviceIcon = "phone" DeviceIconSpeaker DeviceIcon = "speaker" DeviceIconTV DeviceIcon = "tv" DeviceIconGeneric DeviceIcon = "generic" )
View Source
const ( EntityArtist EntityType = "artist" EntityAlbum EntityType = "album" EntityTrack EntityType = "track" EntityAlbumArtist EntityType = "album_artist" EntityAlbumTrack EntityType = "album_track" EntityMediaFile EntityType = "media_file" EntityPlaylist EntityType = "playlist" EntitySmartPlaylistContent EntityType = "smart_playlist_content" EntitySmartPlaylistArtist EntityType = "smart_playlist_artist" EntityPlaylistTrack EntityType = "playlist_track" EntityPlayHistoryItem EntityType = "play_history_item" EntitySearchItem EntityType = "search_item" EntityImport EntityType = "import" EntityRating EntityType = "rating" EntityLike EntityType = "like" EntityEntityEvent EntityType = "entity_event" EntityDevice EntityType = "device" EntityDeviceToken EntityType = "device_token" EntityToken EntityType = "token" EntityTrackAnalysis EntityType = "track_analysis" EntityTrackArtist EntityType = "track_artist" EntityEventDelete EntityEventType = "delete" EntityEventCreate EntityEventType = "create" EntityEventUpdate EntityEventType = "update" )
View Source
const ( ImportStateNotStarted ImportState = "not_started" ImportStateRunning ImportState = "running" ImportStateFinished ImportState = "finished" ImportStateError ImportState = "error" ImportTypeAlbum ImportType = "album" ImportTypeTrack ImportType = "track" )
View Source
const ( PlayContextAlbum PlayContextType = "album" PlayContextLikedTracks PlayContextType = "liked_tracks" PlayContextTopTracks PlayContextType = "top_tracks" PlayContextPlaylist PlayContextType = "playlist" PlayContextFilter PlayContextType = "filter" RepeatOne RepeatType = "one" RepeatAll RepeatType = "all" RepeatOff RepeatType = "off" TrackSourceContext TrackSource = "context" TrackSourceQueue TrackSource = "queue" )
View Source
const ( SiStateNotStarted SyncItemState = "NotStarted" SiStateRunning SyncItemState = "Running" SiStateFinished SyncItemState = "Finished" SiTypeMediaFile SyncItemType = "MediaFile" )
Variables ¶
View Source
var AllUserRoles = []UserRole{ UserRoleAdmin, UserRoleRead, UserRoleWrite, UserRoleImporterWrite, UserRoleUsersRead, UserRoleUsersCreate, UserRoleUsersUpdate, UserRoleUsersDelete, }
Functions ¶
func DecodeEventData ¶
Types ¶
type AlbumArtist ¶
type AlbumArtist struct {
ID uuid.UUID `db:"id" json:"id"`
AlbumID uuid.UUID `db:"album_id" json:"album_id"`
ArtistID uuid.UUID `db:"artist_id" json:"artist_id"`
Role ArtistRole `db:"role" json:"role"`
Position int `db:"position" json:"position"`
CreatedAt time.Time `db:"created_at" json:"created_at"`
UpdatedAt time.Time `db:"updated_at" json:"updated_at"`
}
type AlbumBase ¶
type AlbumBase struct {
MusicBrainzID *string `db:"musicbrainz_id" json:"musicbrainz_id" description:"ID and stuff"`
Name string `db:"name" json:"name"`
SortName string `db:"sort_name" json:"sort_name"`
ReleaseDate *time.Time `db:"release_date" json:"release_date,omitempty"`
Tracks *int `db:"tracks" json:"tracks,omitempty"`
Discs *int `db:"discs" json:"discs,omitempty"`
Description *string `db:"description" json:"description,omitempty"`
Owner string `db:"owner" json:"owner"`
Public *bool `db:"public" json:"public,omitempty"`
}
type AlbumDetailed ¶
type AlbumDetailed struct {
ID string `db:"id" json:"id"`
MusicBrainzID *string `db:"musicbrainz_id" json:"musicbrainz_id"`
Name string `db:"name" json:"name"`
SortName string `db:"sort_name" json:"sort_name"`
ArtistIDs []string `db:"artist_ids" json:"artist_ids,omitempty"`
ArtistNames []string `db:"artist_names" json:"artist_names,omitempty"`
ReleaseDate *time.Time `db:"release_date" json:"release_date,omitempty" ts_type:"string | undefined"`
TrackCount int `db:"track_count" json:"track_count"`
DiscCount int `db:"disc_count" json:"disc_count"`
Description *string `db:"description" json:"description,omitempty"`
Owner string `db:"owner" json:"owner"`
Public *bool `db:"public" json:"public,omitempty"`
CreatedAt time.Time `db:"created_at" json:"created_at"`
UpdatedAt time.Time `db:"updated_at" json:"updated_at"`
}
type AlbumTrack ¶
type AlbumTrack struct {
ID uuid.UUID `db:"id" json:"id"`
AlbumID uuid.UUID `db:"album_id" json:"album_id"`
TrackID uuid.UUID `db:"track_id" json:"track_id"`
DiscNumber int `db:"disc_number" json:"disc_number"`
TrackNumber int `db:"track_number" json:"track_number"`
CreatedAt time.Time `db:"created_at" json:"created_at"`
UpdatedAt time.Time `db:"updated_at" json:"updated_at"`
}
type AlbumUpdate ¶
type Artist ¶
type Artist struct {
ID uuid.UUID `db:"id" json:"id" ts_type:"string"`
ArtistBase
Role ArtistRole `db:"role" json:"role"`
CreatedAt time.Time `db:"created_at" json:"created_at"`
UpdatedAt time.Time `db:"updated_at" json:"updated_at"`
}
type ArtistBase ¶
type ArtistBase struct {
MusicBrainzID *string `db:"musicbrainz_id" json:"musicbrainz_id"`
Name string `db:"name" json:"name" required:"true"`
SortName string `db:"sort_name" json:"sort_name" required:"true"`
Country *string `db:"country" json:"country,omitempty"`
YearStarted *int `db:"year_started" json:"year_started,omitempty"`
YearEnded *int `db:"year_ended" json:"year_ended,omitempty"`
Description *string `db:"description" json:"description,omitempty"`
}
type ArtistDetailed ¶
type ArtistMinimal ¶
type ArtistMinimal struct {
ID uuid.UUID `db:"id" json:"id" ts_type:"string"`
Name string `db:"name" json:"name" required:"true"`
SortName string `db:"sort_name" json:"sort_name" required:"true"`
Role ArtistRole `db:"role" json:"role"`
}
type ArtistRole ¶
type ArtistRole string
const ( ArPrimary ArtistRole = "primary" ArFeatured ArtistRole = "featured" ArComposer ArtistRole = "composer" ArConductor ArtistRole = "conductor" ArProducer ArtistRole = "producer" ArRemixer ArtistRole = "remixer" ArExecutive ArtistRole = "executive" ArPerformer ArtistRole = "performer" ArVocalist ArtistRole = "vocalist" ArLyricist ArtistRole = "lyricist" ArInstrumentalist ArtistRole = "instrumentalist" )
type AuthIdentity ¶
type AuthIdentity struct {
ID uuid.UUID `db:"id" json:"id"`
UserID uuid.UUID `db:"user_id" json:"user_id"`
Provider AuthProvider `db:"provider" json:"provider"`
ProviderUserID uuid.UUID `db:"provider_user_id" json:"provider_user_id"`
Email string `db:"email" json:"email"`
CreatedAt time.Time `db:"created_at" json:"created_at"`
UpdatedAt time.Time `db:"updated_at" json:"updated_at"`
}
type AuthProvider ¶
type AuthProvider string
type ClientConfig ¶
type ClientEvent ¶
type ClientEvent string
const ( ClientEventMsgErr ClientEvent = "msg.error" ClientEventMsgSuccess ClientEvent = "msg.success" ClientEventMsgInfo ClientEvent = "msg.info" ClientEventMsgWarn ClientEvent = "msg.warn" ClientEventServerOnline ClientEvent = "server.status" ClientEventSyncInProgress ClientEvent = "sync.inprogress" ClientEventEntitiesUpdated ClientEvent = "entities.updated" ClientEventPlayerContextChange ClientEvent = "player.contextchange" ClientEventPlayerPlaybackChange ClientEvent = "player.playbackchange" ClientEventUserUpdated ClientEvent = "user.updated" ClientEventAuthLoggedIn ClientEvent = "auth.loggedin" )
type ClientMessage ¶
type ColorScheme ¶
type ColorScheme string
const ( ColorSchemeLight ColorScheme = "light" ColorSchemeDark ColorScheme = "dark" )
type CreateUserApiTokenReq ¶
type CreateUserApiTokenReq struct {
Name string `json:"name"`
}
type CreateUserApiTokenResp ¶
type CreateUserApiTokenResp struct {
Token string `json:"token"`
}
type CreateUserReq ¶
type DBSyncState ¶
type DBSyncState struct {
ID string `db:"id" json:"id"`
SyncedAt time.Time `db:"synced_at" json:"synced_at"`
ArtistsCreated int `db:"artists_created" json:"artists_created"`
ArtistsUpdated int `db:"artists_updated" json:"artists_updated"`
AlbumsCreated int `db:"albums_created" json:"albums_created"`
AlbumsUpdated int `db:"albums_updated" json:"albums_updated"`
TracksCreated int `db:"tracks_created" json:"tracks_created"`
TracksUpdated int `db:"tracks_updated" json:"tracks_updated"`
}
type Device ¶
type Device struct {
DeviceBase
ID uuid.UUID `db:"id" json:"id" ts_type:"string"`
UserID uuid.UUID `db:"user_id" json:"user_id"`
LastIP string `db:"last_ip" json:"last_ip"`
LastSeen time.Time `db:"last_seen" json:"last_seen"`
Active bool `db:"-" json:"active"`
CreatedAt time.Time `db:"created_at" json:"created_at"`
UpdatedAt time.Time `db:"updated_at" json:"updated_at"`
}
type DeviceBase ¶
type DeviceBase struct {
Name string `db:"name" json:"name" `
Type DeviceType `db:"type" json:"type"`
Interface DeviceInterface `db:"interface" json:"interface"`
Icon DeviceIcon `db:"icon" json:"icon"`
SupportsPlayback bool `db:"supports_playback" json:"supports_playback"`
Platform string `db:"platform" json:"platform"`
Version string `db:"version" json:"version"`
}
TODO:UNIQUE(token_id) (maybe, might not be necessary. Should not be able to disable a client, but a token. A token should be able to be used in multiple places)
type DeviceDetailed ¶
type DeviceDetailed struct {
Device
PlayerState *PlayerStateDTO `json:"player_state"`
}
type DeviceIcon ¶
type DeviceIcon string
type DeviceInterface ¶
type DeviceInterface string
type DeviceToken ¶
type DeviceType ¶
type DeviceType string
type EntityEvent ¶
type EntityEvent struct {
ID uuid.UUID `db:"id" json:"id" ts_type:"string"`
ItemID uuid.UUID `db:"item_id" json:"item_id" ts_type:"string"`
UserID uuid.UUID `db:"user_id" json:"user_id" ts_type:"string"`
Type EntityEventType `db:"event_type" json:"event_type"`
EntityType EntityType `db:"entity_type" json:"entity_type"`
EventTime time.Time `db:"event_time" json:"event_time" ts_type:"string"`
}
type EntityEventType ¶
type EntityEventType string
type EntityEvents ¶
type EntityEvents []EntityEvent
func (EntityEvents) LaterDeleteExists ¶
func (es EntityEvents) LaterDeleteExists(e EntityEvent) bool
type FilterMood ¶
type FilterUpperLower ¶
type FilterUpperLower[T any] struct { Upper T `json:"upper"` Lower T `json:"lower"` }
type Healthz ¶
type Healthz struct {
Status HealthzStatus `json:"status"`
}
type HealthzStatus ¶
type HealthzStatus string
const ( HealthzRunning HealthzStatus = "running" HealthzNoAuth HealthzStatus = "no_auth" )
type Import ¶
type Import struct {
ID uuid.UUID `db:"id" json:"id" ts_type:"string"`
MusicBrainzID *string `db:"musicbrainz_id" json:"musicbrainz_id"`
Owner uuid.UUID `db:"owner" json:"owner" ts_type:"string"`
Filename string `db:"filename" json:"filename"`
Type ImportType `db:"type" json:"type"`
State ImportState `db:"state" json:"state"`
CreatedAt time.Time `db:"created_at" json:"created_at" ts_type:"string"`
UpdatedAt time.Time `db:"updated_at" json:"updated_at" ts_type:"string"`
}
type ImportAlbum ¶
type ImportAlbum struct {
MusicbrainzID *string `json:"musicbrainz_id"`
}
type ImportState ¶
type ImportState string
type ImportType ¶
type ImportType string
type JobType ¶
type JobType string
const ( JobImporterRun JobType = "importer:run" JobMetaSyncRun JobType = "metasync:run" JobAuthClientServerStatus JobType = "authclient:serverstatus" JobSyncerDaemon JobType = "syncer:daemon" JobMediaManagerUpdateSyncItems JobType = "mediamanager:update-searchitems" JobAnalyserRunTrackAnalysis JobType = "analyser:run-track-analysis" JobAuthExpiredTokenCleanup JobType = "auth:expired-token-cleanup" )
type ListPaginationPayload ¶
type ListPayload ¶
type LocalCredentials ¶
type MediaFile ¶
type MediaFile struct {
ID uuid.UUID `db:"id" json:"id"`
DurationMs int64 `db:"duration_ms" json:"duration_ms"`
Bitrate int `db:"bitrate" json:"bitrate"`
SampleRate int `db:"sample_rate" json:"sample_rate"`
FileSize int64 `db:"file_size" json:"file_size"`
Codec Codec `db:"codec" json:"codec"`
Checksum string `db:"checksum" json:"checksum"`
CreatedAt time.Time `db:"created_at" json:"created_at"`
UpdatedAt time.Time `db:"updated_at" json:"updated_at"`
OrgFilename string `db:"-" json:"-"`
}
type MediaStream ¶
type MediaStream interface {
io.ReadSeekCloser
Size() (int64, error)
}
type NoResponse ¶
type NoResponse struct{}
type PlayContext ¶
type PlayContext struct {
Type PlayContextType `json:"type"`
RefID uuid.UUID `json:"ref_id" ts_type:"string"`
Tracks []TrackDetailed `json:"tracks" `
TrackOrder []int `json:"track_order"`
Queue []TrackDetailed `json:"queue"`
}
func (PlayContext) DTO ¶
func (pc PlayContext) DTO(deviceID uuid.UUID) PlayContextDTO
type PlayContextDTO ¶
type PlayContextDTO struct {
DeviceID uuid.UUID `json:"device_id" ts_type:"string"`
PlayContext
}
type PlayContextOld ¶
type PlayContextOld struct {
PlaybackState PlaybackState `json:"playback_state"`
Type PlayContextType `json:"type"`
RefID uuid.UUID `json:"ref_id" ts_type:"string"`
Tracks []TrackDetailed `json:"tracks"`
Queue []TrackDetailed `json:"queue"`
CurrentTrackIdx int `json:"current_track_idx"`
CurrentTrack *TrackDetailed `json:"current_track"`
TrackOrder []int `json:"track_order"`
}
func (*PlayContextOld) PullFromQueue ¶
func (pc *PlayContextOld) PullFromQueue() *TrackDetailed
type PlayContextType ¶
type PlayContextType string
type PlayHistory ¶
type PlayHistorySyncState ¶
type PlayHistorySyncState struct {
Time time.Time `json:"time"`
RemoteItems []PlayHistory `json:"remote_items"`
}
type PlaybackState ¶
type PlaybackState struct {
Playing bool `json:"playing"`
Shuffle bool `json:"shuffle"`
Repeat RepeatType `json:"repeat"`
ProgressMS int64 `json:"progress"`
UpdatedAt time.Time `json:"updated_at" ts_type:"string"`
TrackSource TrackSource `json:"track_source"`
TrackIndex int `json:"track_index"`
}
func (PlaybackState) DTO ¶
func (p PlaybackState) DTO(deviceID uuid.UUID) PlaybackStateDTO
func (PlaybackState) TotalProgress ¶
func (p PlaybackState) TotalProgress() int64
type PlaybackStateDTO ¶
type PlaybackStateDTO struct {
DeviceID uuid.UUID `json:"device_id" ts_type:"string"`
PlaybackState
}
type PlayerState ¶
type PlayerState struct {
Playback PlaybackState `json:"playback"`
Context PlayContext `json:"context"`
}
func (*PlayerState) CurrentTrack ¶
func (p *PlayerState) CurrentTrack() (TrackDetailed, error)
func (*PlayerState) DTO ¶
func (p *PlayerState) DTO(deviceID uuid.UUID) PlayerStateDTO
func (*PlayerState) NextTrack ¶
func (p *PlayerState) NextTrack() (contextUpdated, stop bool)
func (*PlayerState) PreviousTrack ¶
func (p *PlayerState) PreviousTrack() (stop bool)
func (*PlayerState) RebuildTrackOrder ¶
func (p *PlayerState) RebuildTrackOrder()
type PlayerStateDTO ¶
type PlayerStateDTO struct {
Playback PlaybackStateDTO `json:"playback"`
Context PlayContextDTO `json:"context"`
}
type Playlist ¶
type Playlist struct {
ID uuid.UUID `db:"id" json:"id" ts_type:"string"`
PlaylistBase
Type PlaylistType `db:"type" json:"type"`
Owner uuid.UUID `db:"owner" json:"owner"`
CreatedAt time.Time `db:"created_at" json:"created_at"`
UpdatedAt time.Time `db:"updated_at" json:"updated_at"`
}
type PlaylistBase ¶
type PlaylistTrack ¶
type PlaylistTrack struct {
ID uuid.UUID `db:"id" json:"id" ts_type:"string"`
PlaylistID uuid.UUID `db:"playlist_id" json:"playlist_id"`
AlbumTrackID uuid.UUID `db:"album_track_id" json:"album_track_id"`
CreatedAt time.Time `db:"created_at" json:"created_at"`
UpdatedAt time.Time `db:"updated_at" json:"updated_at"`
}
type PlaylistTrackReq ¶
type PlaylistType ¶
type PlaylistType string
const ( PlaylistTypeStandard PlaylistType = "standard" PlaylistTypeSmart PlaylistType = "smart" )
type RepeatType ¶
type RepeatType string
type ReqDevicesRegister ¶
type ReqDevicesRegister struct {
ID *uuid.UUID `json:"id" ts_type:"string"`
DeviceBase
}
type ReqPlaylistsAdd ¶
type ReqPlaylistsAdd struct {
PlaylistBase
Filter TrackFilter `json:"filter"`
PlistType string `query:"type" description:"Type of playlist. Defaults to 'standard'" json:"-"`
}
func (ReqPlaylistsAdd) Validate ¶
func (r ReqPlaylistsAdd) Validate() (validationMessages string, err error)
type RespDevicesRegister ¶
type SSEvent ¶
type SSEvent struct {
ID uuid.UUID `json:"id"`
Type SSEventType `json:"type"`
Data json.RawMessage `json:"data"`
}
func SSEDeviceConnected ¶
func SSEDeviceDeleted ¶
func SSEDeviceDisconnected ¶
func SSEDevicePlayContext ¶
func SSEDevicePlayContext(pc PlayContextDTO) SSEvent
func SSEDevicePlaybackState ¶
func SSEDevicePlaybackState(ps PlaybackStateDTO) SSEvent
func SSEDeviceUpdated ¶
func SSEImporterItemsUpdated ¶
func SSEImporterItemsUpdated() SSEvent
func SSEPlayerAddToQueue ¶
func SSEPlayerAddToQueue(t TrackDetailed) SSEvent
func SSEPlayerNextTrack ¶
func SSEPlayerNextTrack() SSEvent
func SSEPlayerPlayContext ¶
func SSEPlayerPlayContext(pc PlayContextDTO) SSEvent
func SSEPlayerPlayPause ¶
func SSEPlayerPlayPause() SSEvent
func SSEPlayerPlaybackState ¶
func SSEPlayerPlaybackState(ps PlaybackStateDTO) SSEvent
func SSEPlayerPreviousTrack ¶
func SSEPlayerPreviousTrack() SSEvent
func SSEPlayerSetRepeat ¶
func SSEPlayerSetRepeat(rt RepeatType) SSEvent
func SSEPlayerSetShuffle ¶
func SSEPlayerSetState ¶
func SSEPlayerSetState(pc PlayerState) SSEvent
func SSEPlayerStop ¶
func SSEPlayerStop() SSEvent
func SSEServerMessage ¶
func SSEServerMessage(level SSEventMsgLevel, title, body string) SSEvent
type SSEventMsgLevel ¶
type SSEventMsgLevel string
const (
SSEventMsgInfo SSEventMsgLevel = "info"
)
type SSEventMsgPayload ¶
type SSEventMsgPayload struct {
Level SSEventMsgLevel `json:"level"`
Title string `json:"title"`
Body string `json:"body"`
}
type SSEventType ¶
type SSEventType string
const ( SSEventTypeServerMessage SSEventType = "server.message" SSEventTypeDeviceConnected SSEventType = "device.connected" SSEventTypeDeviceDisconnected SSEventType = "device.disconnected" SSEventTypeDeviceUpdated SSEventType = "device.updated" SSEventTypeDeviceDeleted SSEventType = "device.deleted" SSEventTypeDevicePlayContext SSEventType = "device.playcontext" SSEventTypeDevicePlaybackState SSEventType = "device.playbackstate" SSEventTypePlayerAddToQueue SSEventType = "player.addtoqueue" SSEventTypePlayerPlayContext SSEventType = "player.playcontext" SSEventTypePlayerPlaybackState SSEventType = "player.playbackstate" SSEventTypePlayerSetRepeat SSEventType = "player.setrepeat" SSEventTypePlayerSetShuffle SSEventType = "player.setshuffle" SSEventTypePlayerSetState SSEventType = "player.setstate" SSEventTypePlayerStop SSEventType = "player.stop" SSEventTypePlayerNextTrack SSEventType = "player.nexttrack" SSEventTypePlayerPlayPause SSEventType = "player.playpause" SSEventTypePlayerPreviousTrack SSEventType = "player.previoustrack" SSEventTypeImporterItemsUpdated SSEventType = "importer.itemsupdated" )
type SearchItem ¶
type SearchItem struct {
Name string `db:"name" json:"name"`
HtmlName string `db:"html_name" json:"html_name"`
ID uuid.UUID `db:"id" json:"id"`
Type EntityType `db:"type" json:"type"`
LinkID uuid.UUID `db:"link_id" json:"link_id"`
LinkType EntityType `db:"link_type" json:"link_type"`
}
type ServerApiInfo ¶
type ServerApiInfo struct {
ServerInfo
Version string `json:"version"`
}
type ServerInfo ¶
type ServerInfo struct {
Application string `json:"application"`
ID uuid.UUID `json:"id" ts_type:"string"`
Status HealthzStatus `json:"status"`
Name string `json:"name"`
}
type SetDevicePlayerRepeatReq ¶
type SetDevicePlayerRepeatReq struct {
Type RepeatType `json:"type" description:"Type of repeat"`
}
type SetDevicePlayerShuffleReq ¶
type SetDevicePlayerShuffleReq struct {
Active bool `json:"active" description:"Shuffle is active"`
}
type SmartPlaylist ¶
type SmartPlaylist struct {
Playlist
Content SmartPlaylistContent
}
type SmartPlaylistArtist ¶
type SmartPlaylistArtist struct {
ID uuid.UUID `db:"id" json:"id" ts_type:"string"`
ParentID uuid.UUID `db:"parent_id" json:"parent_id"`
ArtistID uuid.UUID `db:"artist_id" json:"artist_id"`
Owner uuid.UUID `db:"owner" json:"owner" ts_type:"string"`
CreatedAt time.Time `db:"created_at" json:"created_at"`
UpdatedAt time.Time `db:"updated_at" json:"updated_at"`
}
type SmartPlaylistContent ¶
type SmartPlaylistContent struct {
ID uuid.UUID `db:"id" json:"id" ts_type:"string"`
PlaylistID uuid.UUID `db:"playlist_id" json:"playlist_id"`
BpmUpper *int `db:"bpm_upper" json:"bpm_upper"`
BpmLower *int `db:"bpm_lower" json:"bpm_lower"`
MoodAggressive *float64 `db:"mood_aggressive" json:"mood_aggressive"`
MoodCalm *float64 `db:"mood_calm" json:"mood_calm"`
MoodHappy *float64 `db:"mood_happy" json:"mood_happy"`
MoodSad *float64 `db:"mood_sad" json:"mood_sad"`
Artists *[]uuid.UUID `json:"artists" ts_type:"string[]"`
Owner uuid.UUID `db:"owner" json:"owner" ts_type:"string"`
CreatedAt time.Time `db:"created_at" json:"created_at"`
UpdatedAt time.Time `db:"updated_at" json:"updated_at"`
}
func (SmartPlaylistContent) TrackFilter ¶
func (s SmartPlaylistContent) TrackFilter() TrackFilter
type SyncData ¶
type SyncData struct {
Artists []string `json:"artists"`
Albums []string `json:"albums"`
Tracks []string `json:"tracks"`
AlbumTracks []uuid.UUID `json:"album_tracks"`
AlbumArtists []uuid.UUID `json:"album_artists"`
Playlists []uuid.UUID `json:"playlists"`
PlaylistTracks []uuid.UUID `json:"playlist_tracks"`
MediaFiles []uuid.UUID `json:"media_files"`
}
type SyncItem ¶
type SyncItem struct {
ID uuid.UUID `db:"id" json:"id"`
SyncID uuid.UUID `db:"sync_id" json:"sync_id"`
ItemID uuid.UUID `db:"item_id" json:"item_id"`
Type SyncItemType `db:"type" json:"type"`
State SyncItemState `db:"state" json:"state"`
CreatedAt time.Time `db:"created_at" json:"created_at"`
UpdatedAt time.Time `db:"updated_at" json:"updated_at"`
}
type SyncItemState ¶
type SyncItemState string
type SyncItemType ¶
type SyncItemType string
type SyncPlayHistoryReq ¶
type SyncPlayHistoryReq struct {
ChangesSince time.Time `json:"changes_since"`
UpdatedClientItems []PlayHistory `json:"updated_client_items"`
}
type SyncState ¶
type SyncState struct {
Time time.Time `json:"time"`
CreatedOrUpdated SyncData `json:"created_or_updated"`
Deleted SyncData `json:"deleted"`
New EntityEvents `json:"new"`
}
type Theme ¶
type Theme struct {
Name string `toml:"name" desc:"The name of the theme. Used in the GUI for human readable selection."`
ColorScheme ColorScheme `toml:"color_scheme" desc:"Define if your color scheme is light or dark. Nothing else is accepted."`
Colors ThemeColors `toml:"colors" desc:"Definition of all colors of the theme."`
}
type ThemeColors ¶
type ThemeColors struct {
Accent HexColor `toml:"accent" desc:"Main brand color"`
AccentForeground HexColor `toml:"accent_foreground" desc:"Foreground color on components with accent background."`
Background HexColor `toml:"background" desc:"Background color of the main frame."`
Border HexColor `toml:"border" desc:"Border color."`
Danger HexColor `toml:"danger" desc:"Error message color."`
DangerForeground HexColor `toml:"danger_foreground" desc:"Foreground color on components with error background."`
Default HexColor `` /* 140-byte string literal not displayed */
DefaultForeground HexColor `toml:"default_foreground" desc:"Used for player buttons, excluding play/pause."`
FieldForeground HexColor `toml:"field_foreground" desc:"Text color in forms."`
Foreground HexColor `toml:"foreground" desc:"Main text color."`
Overlay HexColor `toml:"overlay" desc:"Background in popup windows."`
Success HexColor `toml:"success" desc:"Success message color."`
SuccessForeground HexColor `toml:"success_foreground" desc:"Foreground color on components with success background."`
Surface HexColor `toml:"surface" desc:"Background color of player, cards and notifications."`
Surface2 HexColor `toml:"surface2" desc:"Background color of the menu."`
Warning HexColor `toml:"warning" desc:"Warning message color."`
WarningForeground HexColor `toml:"warning_foreground" desc:"Foreground color on components with warning background."`
}
type ThemeDescription ¶
type Token ¶
type Token struct {
ID uuid.UUID `db:"id" json:"id"`
UserID uuid.UUID `db:"user_id" json:"user_id"`
Type TokenType `db:"type" json:"type"`
Name *string `db:"name" json:"name,omitempty"`
Hash string `db:"hash" json:"-"`
Scopes string `db:"scopes" json:"scopes"`
ExpiresAt *time.Time `db:"expires_at" json:"expires_at,omitempty"`
LastUsedAt *time.Time `db:"last_used_at" json:"last_used_at,omitempty"`
CreatedAt time.Time `db:"created_at" json:"created_at"`
UpdatedAt time.Time `db:"updated_at" json:"updated_at"`
}
type TokenLimited ¶
type TokenLimited struct {
ID uuid.UUID `db:"id" json:"id" ts_type:"string"`
Type TokenType `db:"type" json:"type"`
Name *string `db:"name" json:"name,omitempty"`
Scopes string `db:"scopes" json:"scopes"`
ExpiresAt *time.Time `db:"expires_at" json:"expires_at,omitempty" ts_type:"string"`
LastUsedAt *time.Time `db:"last_used_at" json:"last_used_at,omitempty" ts_type:"string"`
CreatedAt time.Time `db:"created_at" json:"created_at" ts_type:"string"`
UpdatedAt time.Time `db:"updated_at" json:"updated_at" ts_type:"string"`
}
type Track ¶
type Track struct {
ID uuid.UUID `db:"id" json:"id"` // UUID
Title string `db:"title" json:"title"`
MusicBrainzID *string `db:"musicbrainz_id" json:"musicbrainz_id"`
Genre *string `db:"genre" json:"genre,omitempty"`
Comment *string `db:"comment" json:"comment,omitempty"`
MediaFile *uuid.UUID `db:"media_file" json:"media_file"`
TitleMatch float32 `db:"-" json:"-"`
CreatedAt time.Time `db:"created_at" json:"created_at"`
UpdatedAt time.Time `db:"updated_at" json:"updated_at"`
}
type TrackAnalysis ¶
type TrackAnalysisResults ¶
type TrackAnalysisResults struct {
BPM int `db:"bpm" json:"bpm"`
Key string `db:"key" json:"key"`
KeyScale string `db:"key_scale" json:"key_scale"`
KeyConfidence float64 `db:"key_confidence" json:"key_confidence"`
Loudness int `db:"loudness" json:"loudness"`
Energy float64 `db:"energy" json:"energy"`
Danceability float64 `db:"danceability" json:"danceability"`
MoodHappy float64 `db:"mood_happy" json:"mood_happy"`
MoodSad float64 `db:"mood_sad" json:"mood_sad"`
MoodAggresive float64 `db:"mood_aggresive" json:"mood_aggresive"`
MoodCalm float64 `db:"mood_calm" json:"mood_calm"`
}
type TrackArtist ¶
type TrackArtist struct {
ID uuid.UUID `db:"id" json:"id"`
TrackID uuid.UUID `db:"track_id" json:"album_id"`
ArtistID uuid.UUID `db:"artist_id" json:"artist_id"`
Role ArtistRole `db:"role" json:"role"`
CreatedAt time.Time `db:"created_at" json:"created_at"`
UpdatedAt time.Time `db:"updated_at" json:"updated_at"`
}
type TrackDetailed ¶
type TrackDetailed struct {
ID uuid.UUID `db:"id" json:"id" ts_type:"string"` // UUID
Title string `db:"title" json:"title"`
AlbumID string `db:"album_id" json:"album_id,omitempty"`
AlbumName string `db:"album_name" json:"album_name,omitempty"`
// ArtistIDs []string `db:"artist_ids" json:"artist_ids,omitempty"`
// ArtistNames []string `db:"artist_names" json:"artist_names,omitempty"`
Artists []ArtistMinimal `json:"artists,omitempty"`
MusicBrainzID *string `db:"musicbrainz_id" json:"musicbrainz_id"`
TrackNumber int `db:"track_number" json:"track_number,omitempty"`
DiscNumber int `db:"disc_number" json:"disc_number,omitempty"`
Genre *string `db:"genre" json:"genre,omitempty"`
Comment *string `db:"comment" json:"comment,omitempty"`
MediaFile *MediaFile `db:"media_file" json:"media_file"`
PlayCount int `db:"play_count" json:"play_count"`
ContextID *uuid.UUID `db:"context_id" json:"context_id" ts_type:"string"`
Rating *float64 `json:"rating"`
UserRating *int `json:"user_rating"`
Liked bool `json:"liked"`
CreatedAt time.Time `db:"created_at" json:"created_at"`
UpdatedAt time.Time `db:"updated_at" json:"updated_at"`
Analysis TrackAnalysis `json:"analysis"`
}
func (TrackDetailed) ArtistNames ¶
func (t TrackDetailed) ArtistNames() []string
type TrackDetailedNew ¶
type TrackDetailedNew struct {
Track Track `json:"track"`
Album Album `json:"album"`
Artists []Artist `json:"artists"`
AlbumTrack AlbumTrack `json:"album_track"`
Mediafile *MediaFile `json:"media_file"`
Analysis TrackAnalysis `json:"analysis"`
}
type TrackFilter ¶
type TrackFilter struct {
BPM *FilterUpperLower[int] `json:"bpm"`
Mood FilterMood `json:"mood"`
Artists *[]uuid.UUID `json:"artists" ts_type:"string[]"`
}
type TrackSource ¶
type TrackSource string
type TrackUpdate ¶
type UpdateProfileReq ¶
type UpdateUserReq ¶
type UserDetails ¶
type UserDetails struct {
ID uuid.UUID `db:"id" json:"id" ts_type:"string"`
Email string `db:"email" json:"email"`
Username string `db:"username" json:"username"`
Provider AuthProvider `db:"provider" json:"provider"`
Roles []UserRole `db:"role" json:"role"`
CreatedAt time.Time `db:"created_at" json:"created_at"`
}
func (UserDetails) HasRole ¶
func (u UserDetails) HasRole(r UserRole) bool
Source Files
¶
Click to show internal directories.
Click to hide internal directories.