Versions in this module Expand all Collapse all v0 v0.1.0 Jan 4, 2025 Changes in this version + func Generate(host, user, database string) error + type DB struct + func Init(ctx context.Context, opts Opts, logger *slog.Logger) (*DB, error) + func (d *DB) AddPlayedAlbum(ctx context.Context, album client.AlbumFull) error + func (d *DB) AddPlaylist(ctx context.Context, title, description string) error + func (d *DB) AddStreamingAlbum(ctx context.Context, album *streaming.AlbumFull) error + func (d *DB) AddStreamingArtist(ctx context.Context, artist *streaming.Artist) error + func (d *DB) AddStreamingTrackToPlaylist(ctx context.Context, playlistID uuid.UUID, track *streaming.Track) error + func (d *DB) AddTrackToPlaylist(ctx context.Context, playlistID uuid.UUID, trackID uuid.UUID) error + func (d *DB) DeleteFileTrack(ctx context.Context, id uuid.UUID) error + func (d *DB) GetAlbumFull(ctx context.Context, id uuid.UUID) (libModel.AlbumFull, error) + func (d *DB) GetAlbums(ctx context.Context, sortBy string, offset int, limit int) ([]libModel.AlbumWithArtists, error) + func (d *DB) GetAllFileTracks(ctx context.Context) ([]libModel.Track, error) + func (d *DB) GetAllPlaylists(ctx context.Context) ([]libModel.Playlist, error) + func (d *DB) GetArtistFull(ctx context.Context, id uuid.UUID) (libModel.ArtistFull, error) + func (d *DB) GetArtists(ctx context.Context) ([]libModel.Artist, error) + func (d *DB) GetFileTrack(ctx context.Context, path string) (libModel.Track, error) + func (d *DB) GetLastRun(ctx context.Context) (time.Time, error) + func (d *DB) GetPlayedAlbums(ctx context.Context, offset int, limit int) ([]libModel.PlayedAlbum, error) + func (d *DB) GetPlaylistFull(ctx context.Context, id uuid.UUID) (libModel.PlaylistFull, error) + func (d *DB) GetStreamingAlbum(ctx context.Context, id string) (libModel.Album, error) + func (d *DB) GetStreamingAlbumFull(ctx context.Context, id string) (libModel.AlbumFull, error) + func (d *DB) GetStreamingArtist(ctx context.Context, id string) (libModel.Artist, error) + func (d *DB) GetStreamingArtistFull(ctx context.Context, id string) (libModel.ArtistFull, error) + func (d *DB) GetTrack(ctx context.Context, id uuid.UUID) (libModel.Track, error) + func (d *DB) Search(ctx context.Context, query string, limit int) (libModel.SearchRes, error) + func (d *DB) SetLastRun(ctx context.Context, time time.Time) error + func (d *DB) SyncFileTrack(ctx context.Context, track files.TrackFull) error + type Opts struct + Database string + Host string + Password string + Port int + User string