Documentation
¶
Index ¶
- func DecryptPassword(encryptedPassword []byte) (string, error)
- func EncryptPassword(password string) ([]byte, error)
- func FallbackGain() float64
- func SetFallbackGain(gain float64)
- type Album
- type AlbumAnnotations
- type AlbumArtistConnection
- type AlbumInfo
- type AlbumLists
- type AlbumPlayInfo
- type AlbumRepository
- type AlbumTrackInfo
- type Artist
- type ArtistAlbumInfo
- type ArtistAnnotations
- type ArtistInfo
- type ArtistRef
- type ArtistRepository
- type CompleteAlbum
- type CompleteArtist
- type CompletePlaylist
- type CompleteSong
- type CreateAlbumParams
- type CreateArtistParams
- type CreateInternetRadioStationParams
- type CreatePlaylistParams
- type CreateScrobbleParams
- type CreateSongParams
- type DB
- type DurationMS
- type Error
- type ErrorType
- type FindAlbumParams
- type FindAlbumSortBy
- type FindAlbumsByNameWithArtistMatchCountResult
- type FindArtistsParams
- type Genre
- type GenreRepository
- type GenreWithCounts
- type IncludeAlbumInfo
- type IncludeArtistInfo
- type IncludePlaylistInfo
- type IncludeSongInfo
- type InternetRadioStation
- type InternetRadioStationRepository
- type NowPlayingSong
- type NullDurationMS
- type Optional
- type OptionalGetter
- type Paginate
- type Playlist
- type PlaylistRepository
- type PlaylistTrackInfo
- type Scrobble
- type ScrobbleRepository
- type ScrobbleTopSong
- type SetAlbumInfo
- type SetArtistInfo
- type Song
- type SongAlbumInfo
- type SongAnnotations
- type SongArtistConnection
- type SongFindBySearchParams
- type SongFindRandomParams
- type SongGenreConnection
- type SongLists
- type SongPlayInfo
- type SongRepository
- type SongSetLBFeedbackUpdatedParams
- type SongStreamInfo
- type StringList
- type SystemRepository
- type Transaction
- type Tx
- type UpdateAlbumParams
- type UpdateArtistParams
- type UpdateInternetRadioStationParams
- type UpdatePlaylistParams
- type UpdateSongAllParams
- type UpdateSongParams
- type User
- type UserRepository
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecryptPassword ¶
func EncryptPassword ¶
func FallbackGain ¶
func FallbackGain() float64
func SetFallbackGain ¶
func SetFallbackGain(gain float64)
Types ¶
type Album ¶
type Album struct { ID string `db:"id"` Name string `db:"name"` Created time.Time `db:"created"` Updated time.Time `db:"updated"` Year *int `db:"year"` RecordLabels StringList `db:"record_labels"` MusicBrainzID *string `db:"music_brainz_id"` ReleaseMBID *string `db:"release_mbid"` ReleaseTypes StringList `db:"release_types"` IsCompilation *bool `db:"is_compilation"` ReplayGain *float64 `db:"replay_gain"` ReplayGainPeak *float64 `db:"replay_gain_peak"` }
type AlbumAnnotations ¶
type AlbumArtistConnection ¶
type AlbumLists ¶
type AlbumPlayInfo ¶
type AlbumRepository ¶
type AlbumRepository interface { Create(ctx context.Context, params CreateAlbumParams) (string, error) Update(ctx context.Context, id string, params UpdateAlbumParams) error DeleteIfNoTracks(ctx context.Context) error FindByID(ctx context.Context, id string, include IncludeAlbumInfo) (*CompleteAlbum, error) FindAll(ctx context.Context, params FindAlbumParams, include IncludeAlbumInfo) ([]*CompleteAlbum, error) FindBySearch(ctx context.Context, query string, paginate Paginate, include IncludeAlbumInfo) ([]*CompleteAlbum, error) FindStarred(ctx context.Context, paginate Paginate, include IncludeAlbumInfo) ([]*CompleteAlbum, error) GetTracks(ctx context.Context, id string, include IncludeSongInfo) ([]*CompleteSong, error) Star(ctx context.Context, user, albumID string) error UnStar(ctx context.Context, user, albumID string) error SetRating(ctx context.Context, user, albumID string, rating int) error RemoveRating(ctx context.Context, user, albumID string) error GetInfo(ctx context.Context, albumID string, after time.Time) (*AlbumInfo, error) SetInfo(ctx context.Context, albumID string, params SetAlbumInfo) error GetAllArtistConnections(ctx context.Context) ([]AlbumArtistConnection, error) RemoveAllArtistConnections(ctx context.Context) error CreateArtistConnections(ctx context.Context, connections []AlbumArtistConnection) error }
type AlbumTrackInfo ¶
type AlbumTrackInfo struct { TrackCount int `db:"track_count"` Duration DurationMS `db:"duration_ms"` }
type ArtistAlbumInfo ¶
type ArtistAlbumInfo struct {
AlbumCount int `db:"album_count"`
}
type ArtistAnnotations ¶
type ArtistInfo ¶
type ArtistRepository ¶
type ArtistRepository interface { Create(ctx context.Context, params CreateArtistParams) (string, error) CreateIfNotExistsByName(ctx context.Context, params []CreateArtistParams) error Update(ctx context.Context, id string, params UpdateArtistParams) error DeleteIfNoAlbumsAndNoSongs(ctx context.Context) error FindOrCreateIDsByNames(ctx context.Context, names []string) ([]string, error) FindByID(ctx context.Context, id string, include IncludeArtistInfo) (*CompleteArtist, error) FindByNames(ctx context.Context, names []string, include IncludeArtistInfo) ([]*CompleteArtist, error) FindAll(ctx context.Context, params FindArtistsParams, include IncludeArtistInfo) ([]*CompleteArtist, error) FindBySearch(ctx context.Context, query string, onlyAlbumArtists bool, paginate Paginate, include IncludeArtistInfo) ([]*CompleteArtist, error) FindStarred(ctx context.Context, paginate Paginate, include IncludeArtistInfo) ([]*CompleteArtist, error) GetAlbums(ctx context.Context, id string, include IncludeAlbumInfo) ([]*CompleteAlbum, error) Star(ctx context.Context, user, artistID string) error UnStar(ctx context.Context, user, artistID string) error SetRating(ctx context.Context, user, artistID string, rating int) error RemoveRating(ctx context.Context, user, artistID string) error GetInfo(ctx context.Context, artistID string, after time.Time) (*ArtistInfo, error) SetInfo(ctx context.Context, artistID string, params SetArtistInfo) error }
type CompleteAlbum ¶
type CompleteAlbum struct { Album *AlbumTrackInfo *AlbumAnnotations *AlbumPlayInfo *AlbumLists }
type CompleteArtist ¶
type CompleteArtist struct { Artist *ArtistAnnotations *ArtistAlbumInfo }
type CompletePlaylist ¶
type CompletePlaylist struct { Playlist *PlaylistTrackInfo }
type CompleteSong ¶
type CompleteSong struct { Song *SongAlbumInfo *SongAnnotations *SongPlayInfo *SongLists }
type CreateAlbumParams ¶
type CreateAlbumParams struct { Name string Year *int RecordLabels StringList MusicBrainzID *string ReleaseMBID *string ReleaseTypes StringList IsCompilation *bool ReplayGain *float64 ReplayGainPeak *float64 }
type CreateArtistParams ¶
type CreatePlaylistParams ¶
type CreateScrobbleParams ¶
type CreateScrobbleParams struct { User string SongID string AlbumID *string Time time.Time SongDuration DurationMS Duration NullDurationMS SubmittedToListenBrainz bool NowPlaying bool }
type CreateSongParams ¶
type CreateSongParams struct { ID *string Path string AlbumID *string Title string Track *int Year *int Size int64 ContentType string Duration DurationMS BitRate int SamplingRate int ChannelCount int Disc *int BPM *int MusicBrainzID *string ReplayGain *float64 ReplayGainPeak *float64 Lyrics *string }
type DurationMS ¶
func NewDurationMS ¶
func NewDurationMS(millis int64) DurationMS
func NewDurationMSFromStd ¶
func NewDurationMSFromStd(d time.Duration) DurationMS
func (DurationMS) Millis ¶
func (nt DurationMS) Millis() int64
func (*DurationMS) Scan ¶
func (nt *DurationMS) Scan(value any) error
func (DurationMS) Seconds ¶
func (nt DurationMS) Seconds() int
func (DurationMS) ToStd ¶
func (nt DurationMS) ToStd() time.Duration
type FindAlbumParams ¶
type FindAlbumParams struct { SortBy FindAlbumSortBy FromYear *int ToYear *int Genres []string Paginate Paginate }
type FindAlbumSortBy ¶
type FindAlbumSortBy int
const ( FindAlbumSortByName FindAlbumSortBy = iota FindAlbumSortByCreated FindAlbumSortByRating FindAlbumSortByStarred FindAlbumSortRandom FindAlbumSortByYear FindAlbumSortByFrequent FindAlbumSortByRecent )
type FindArtistsParams ¶
type GenreRepository ¶
type GenreWithCounts ¶
type IncludeAlbumInfo ¶
type IncludeAlbumInfo struct { TrackInfo bool User string Annotations bool PlayInfo bool Genres bool Artists bool }
func IncludeAlbumInfoBare ¶
func IncludeAlbumInfoBare() IncludeAlbumInfo
func IncludeAlbumInfoFull ¶
func IncludeAlbumInfoFull(user string) IncludeAlbumInfo
type IncludeArtistInfo ¶
func IncludeArtistInfoBare ¶
func IncludeArtistInfoBare() IncludeArtistInfo
func IncludeArtistInfoFull ¶
func IncludeArtistInfoFull(user string) IncludeArtistInfo
type IncludePlaylistInfo ¶
type IncludePlaylistInfo struct {
TrackInfo bool
}
func IncludePlaylistInfoBare ¶
func IncludePlaylistInfoBare() IncludePlaylistInfo
func IncludePlaylistInfoFull ¶
func IncludePlaylistInfoFull() IncludePlaylistInfo
type IncludeSongInfo ¶
func IncludeSongInfoAlbum ¶
func IncludeSongInfoAlbum() IncludeSongInfo
func IncludeSongInfoBare ¶
func IncludeSongInfoBare() IncludeSongInfo
func IncludeSongInfoFull ¶
func IncludeSongInfoFull(user string) IncludeSongInfo
type InternetRadioStation ¶
type InternetRadioStationRepository ¶
type InternetRadioStationRepository interface { FindAll(ctx context.Context, user string) ([]*InternetRadioStation, error) Create(ctx context.Context, user string, params CreateInternetRadioStationParams) (*InternetRadioStation, error) Update(ctx context.Context, user, id string, params UpdateInternetRadioStationParams) error Delete(ctx context.Context, user, id string) error }
type NowPlayingSong ¶
type NowPlayingSong struct { *CompleteSong User string `db:"user_name"` Time time.Time `db:"time"` }
type NullDurationMS ¶
type NullDurationMS struct { Duration DurationMS Valid bool }
func (*NullDurationMS) Scan ¶
func (nt *NullDurationMS) Scan(value any) error
type Optional ¶
type Optional[T any] struct { // contains filtered or unexported fields }
func NewOptional ¶
func NewOptionalEmpty ¶
func NewOptionalFull ¶
type OptionalGetter ¶
type PlaylistRepository ¶
type PlaylistRepository interface { Create(ctx context.Context, params CreatePlaylistParams) (*Playlist, error) Update(ctx context.Context, user, id string, params UpdatePlaylistParams) error FindByID(ctx context.Context, user, id string, include IncludePlaylistInfo) (*CompletePlaylist, error) FindAll(ctx context.Context, user string, include IncludePlaylistInfo) ([]*CompletePlaylist, error) GetTracks(ctx context.Context, id string, include IncludeSongInfo) ([]*CompleteSong, error) AddTracks(ctx context.Context, id string, songIDs []string) error RemoveTracks(ctx context.Context, id string, trackNumbers []int) error ClearTracks(ctx context.Context, id string) error SetTracks(ctx context.Context, id string, songIDs []string) error Delete(ctx context.Context, user, id string) error }
type PlaylistTrackInfo ¶
type PlaylistTrackInfo struct { TrackCount int `db:"track_count"` Duration DurationMS `db:"duration_ms"` }
type Scrobble ¶
type Scrobble struct { User string `db:"user_name"` SongID string `db:"song_id"` AlbumID *string `db:"album_id"` Time time.Time `db:"time"` SongDuration DurationMS `db:"song_duration_ms"` Duration NullDurationMS `db:"duration_ms"` SubmittedToListenBrainz bool `db:"submitted_to_listenbrainz"` NowPlaying bool `db:"now_playing"` }
type ScrobbleRepository ¶
type ScrobbleRepository interface { CreateMultiple(ctx context.Context, params []CreateScrobbleParams) error FindPossibleConflicts(ctx context.Context, user string, songIDs []string, times []time.Time) ([]*Scrobble, error) DeleteNowPlaying(ctx context.Context, user string) error GetNowPlaying(ctx context.Context, user string) (*Scrobble, error) GetNowPlayingSongs(ctx context.Context, include IncludeSongInfo) ([]*NowPlayingSong, error) FindUnsubmittedLBScrobbles(ctx context.Context) ([]*Scrobble, error) SetLBSubmittedByUsers(ctx context.Context, users []string) error GetDurationSum(ctx context.Context, user string, start, end time.Time) (DurationMS, error) GetDistinctSongCount(ctx context.Context, user string, start, end time.Time) (int, error) GetDistinctAlbumCount(ctx context.Context, user string, start, end time.Time) (int, error) GetDistinctArtistCount(ctx context.Context, user string, start, end time.Time) (int, error) GetTopSongsByDuration(ctx context.Context, user string, start, end time.Time, offset, limit int, include IncludeSongInfo) ([]*ScrobbleTopSong, error) }
type ScrobbleTopSong ¶
type ScrobbleTopSong struct { *CompleteSong TotalDuration DurationMS `db:"total_duration_ms"` }
type SetAlbumInfo ¶
type SetArtistInfo ¶
type Song ¶
type Song struct { ID string `db:"id"` Path string `db:"path"` AlbumID *string `db:"album_id"` Title string `db:"title"` Track *int `db:"track"` Year *int `db:"year"` Size int64 `db:"size"` ContentType string `db:"content_type"` Duration DurationMS `db:"duration_ms"` BitRate int `db:"bit_rate"` SamplingRate int `db:"sampling_rate"` ChannelCount int `db:"channel_count"` Disc *int `db:"disc_number"` Created time.Time `db:"created"` Updated time.Time `db:"updated"` BPM *int `db:"bpm"` MusicBrainzID *string `db:"music_brainz_id"` ReplayGain *float64 `db:"replay_gain"` ReplayGainPeak *float64 `db:"replay_gain_peak"` Lyrics *string `db:"lyrics"` }
type SongAlbumInfo ¶
type SongAnnotations ¶
type SongArtistConnection ¶
type SongFindBySearchParams ¶
type SongFindRandomParams ¶
type SongGenreConnection ¶
type SongPlayInfo ¶
type SongRepository ¶
type SongRepository interface { FindByID(ctx context.Context, id string, include IncludeSongInfo) (*CompleteSong, error) FindByIDs(ctx context.Context, ids []string, include IncludeSongInfo) ([]*CompleteSong, error) FindByMusicBrainzID(ctx context.Context, mbid string, include IncludeSongInfo) ([]*CompleteSong, error) FindByPath(ctx context.Context, path string, include IncludeSongInfo) (*CompleteSong, error) FindRandom(ctx context.Context, params SongFindRandomParams, include IncludeSongInfo) ([]*CompleteSong, error) FindBySearch(ctx context.Context, params SongFindBySearchParams, include IncludeSongInfo) ([]*CompleteSong, error) FindStarred(ctx context.Context, paginate Paginate, include IncludeSongInfo) ([]*CompleteSong, error) FindByGenre(ctx context.Context, genre string, paginate Paginate, include IncludeSongInfo) ([]*CompleteSong, error) FindByTitle(ctx context.Context, title string, include IncludeSongInfo) ([]*CompleteSong, error) FindAllByPathOrMBID(ctx context.Context, paths []string, mbids []string, include IncludeSongInfo) ([]*CompleteSong, error) FindNonExistentIDs(ctx context.Context, ids []string) ([]string, error) FindPaths(ctx context.Context, updatedBefore time.Time, paginate Paginate) ([]string, error) DeleteByPaths(ctx context.Context, paths []string) error GetStreamInfo(ctx context.Context, id string) (*SongStreamInfo, error) Create(ctx context.Context, params CreateSongParams) (*Song, error) Update(ctx context.Context, id string, params UpdateSongParams) error CreateAll(ctx context.Context, params []CreateSongParams) error TryUpdateAll(ctx context.Context, params []UpdateSongAllParams) (int, error) DeleteLastUpdatedBefore(ctx context.Context, before time.Time) error DeleteArtistConnections(ctx context.Context, songIDs []string) error CreateArtistConnections(ctx context.Context, connections []SongArtistConnection) error DeleteGenreConnections(ctx context.Context, songIDs []string) error CreateGenreConnections(ctx context.Context, connections []SongGenreConnection) error Star(ctx context.Context, user, songID string) error StarMultiple(ctx context.Context, user string, songID []string) (int, error) UnStar(ctx context.Context, user, songID string) error SetRating(ctx context.Context, user, songID string, rating int) error RemoveRating(ctx context.Context, user, songID string) error SetLBFeedbackUpdated(ctx context.Context, user string, params []SongSetLBFeedbackUpdatedParams) error RemoveLBFeedbackUpdated(ctx context.Context, user string, songIDs []string) error FindLBFeedbackUpdatedSongIDsInMBIDListNotStarred(ctx context.Context, user string, mbids []string) ([]string, error) DeleteLBFeedbackUpdatedStarsNotInMBIDList(ctx context.Context, user string, mbids []string) (int, error) FindNotLBUpdatedSongs(ctx context.Context, user string, include IncludeSongInfo) ([]*CompleteSong, error) Count(ctx context.Context) (int, error) GetMedianReplayGain(ctx context.Context) (float64, error) }
type SongStreamInfo ¶
type SongStreamInfo struct { Path string `db:"path"` BitRate int `db:"bit_rate"` ContentType string `db:"content_type"` Duration DurationMS `db:"duration_ms"` ChannelCount int `db:"channel_count"` }
type StringList ¶
type StringList []string
func (*StringList) Scan ¶
func (nt *StringList) Scan(value interface{}) error
type SystemRepository ¶
type Transaction ¶
type Tx ¶
type Tx interface { User() UserRepository System() SystemRepository Song() SongRepository Scrobble() ScrobbleRepository Album() AlbumRepository Artist() ArtistRepository Genre() GenreRepository Playlist() PlaylistRepository InternetRadioStation() InternetRadioStationRepository }
type UpdateAlbumParams ¶
type UpdateArtistParams ¶
type UpdatePlaylistParams ¶
type UpdateSongAllParams ¶
type UpdateSongAllParams struct { ID string Path string AlbumID *string Title string Track *int Year *int Size int64 ContentType string Duration DurationMS BitRate int SamplingRate int ChannelCount int Disc *int BPM *int MusicBrainzID *string ReplayGain *float64 ReplayGainPeak *float64 Lyrics *string }
type UpdateSongParams ¶
type UpdateSongParams struct { Path Optional[string] AlbumID Optional[*string] Title Optional[string] Track Optional[*int] Year Optional[*int] Size Optional[int64] ContentType Optional[string] Duration Optional[DurationMS] BitRate Optional[int] SamplingRate Optional[int] ChannelCount Optional[int] Disc Optional[*int] BPM Optional[*int] MusicBrainzID Optional[*string] ReplayGain Optional[*float64] ReplayGainPeak Optional[*float64] Lyrics Optional[*string] }
type UserRepository ¶
type UserRepository interface { Create(ctx context.Context, name, password string) error UpdateListenBrainzConnection(ctx context.Context, user string, lbUsername, lbToken *string) error FindAll(ctx context.Context) ([]*User, error) FindByName(ctx context.Context, name string) (*User, error) DeleteByName(ctx context.Context, name string) error }
Source Files
¶
Click to show internal directories.
Click to hide internal directories.