library

package
v0.0.0-...-e7feb91 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 6, 2024 License: AGPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrAlbumNotFound = errors.New("album not found in library")
View Source
var (
	ErrArtistNotFound = errors.New("artist not found in library")
)
View Source
var (
	ErrPlaylistNotFound = errors.New("playlist not found in library")
)
View Source
var ErrTrackNotFound = errors.New("track not found in library")

Functions

This section is empty.

Types

type Album

type Album struct {
	model.Album
	Artists []model.Artist
}

type AlbumFull

type AlbumFull struct {
	Album  Album
	Tracks []Track
}

type ArtistFull

type ArtistFull struct {
	Artist model.Artist
	Albums []Album
}

type Library

type Library struct {
	// contains filtered or unexported fields
}

func Init

func Init() (Library, error)

func (*Library) AddAlbum

func (l *Library) AddAlbum(album model.Album) error
func (l *Library) AddAlbumArtistLink(artistID, albumID uuid.UUID, appearance bool) error

func (*Library) AddArtist

func (l *Library) AddArtist(artist model.Artist) error

func (*Library) AddPlaylist

func (l *Library) AddPlaylist(title, description string) error
func (l *Library) AddPlaylistTrackLink(playlistID, trackID uuid.UUID) error

func (*Library) AddTrack

func (l *Library) AddTrack(track model.Track) error
func (l *Library) AddTrackArtistLink(artistID, trackId uuid.UUID) error

func (*Library) GetAlbum

func (l *Library) GetAlbum(id string, isStreamingId bool) (Album, error)

func (*Library) GetAlbumFull

func (l *Library) GetAlbumFull(id string, isStreamingId bool) (AlbumFull, error)

func (*Library) GetAllAlbums

func (l *Library) GetAllAlbums(sortBy string, offset int, limit int) ([]Album, error)

func (*Library) GetAllArtists

func (l *Library) GetAllArtists() ([]model.Artist, error)

func (*Library) GetAllPlaylists

func (l *Library) GetAllPlaylists() ([]model.Playlist, error)

func (*Library) GetArtist

func (l *Library) GetArtist(id string, isStreamingId bool) (model.Artist, error)

func (*Library) GetArtistFull

func (l *Library) GetArtistFull(id string, isStreamingId bool) (ArtistFull, error)

func (*Library) GetPlaylistFull

func (l *Library) GetPlaylistFull(id string) (PlaylistFull, error)

func (*Library) GetTrack

func (l *Library) GetTrack(id string, isStreamingId bool) (Track, error)

func (*Library) Search

func (l *Library) Search(ctx context.Context, query string, limit int) (SearchResult, error)

func (*Library) UpgradeAlbum

func (l *Library) UpgradeAlbum(id uuid.UUID, imageUrl string, release time.Time, trackNum int) error

func (*Library) UpgradeArtist

func (l *Library) UpgradeArtist(id uuid.UUID) error

type PlaylistFull

type PlaylistFull struct {
	Playlist model.Playlist
	Tracks   []Track
}

type SearchResult

type SearchResult struct {
	Artists []model.Artist
	Albums  []Album
	Tracks  []Track
}

type Track

type Track struct {
	model.Track
	Artists []model.Artist
	Album   Album
}

Directories

Path Synopsis
dbgen

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL