db

package
v0.0.36 Latest Latest
Warning

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

Go to latest
Published: May 19, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Db

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

func LoadDb

func LoadDb(
	path string,
) (*Db, error)

func NewDb

func NewDb(path string) (*Db, error)

func (*Db) AddMusic

func (d *Db) AddMusic(music *Music) error

func (*Db) AddMusicToPlaylist

func (d *Db) AddMusicToPlaylist(musicName, playlistName string) error

func (*Db) AddPlaylist

func (d *Db) AddPlaylist(plname string) error

func (*Db) CleanCache added in v0.0.30

func (d *Db) CleanCache() error

func (*Db) Close

func (d *Db) Close() error

func (*Db) FilterMusic

func (d *Db) FilterMusic(query string) ([]Music, error)

func (*Db) GetCachedMusics added in v0.0.30

func (d *Db) GetCachedMusics() ([]Music, error)

func (*Db) GetMusic

func (d *Db) GetMusic(source string, key string) (Music, error)

func (*Db) GetMusicByHash

func (d *Db) GetMusicByHash(hash string) (Music, error)

func (*Db) GetMusicByHashPrefix added in v0.0.30

func (d *Db) GetMusicByHashPrefix(hash_p string) (Music, error)

func (*Db) GetMusicByKeySource

func (d *Db) GetMusicByKeySource(source string, key string) (Music, error)

func (*Db) GetMusicByName

func (d *Db) GetMusicByName(name string) (Music, error)

func (*Db) GetMusicsFromPlaylist

func (d *Db) GetMusicsFromPlaylist(playlistName string) ([]Music, error)

func (*Db) GetPlaylist

func (d *Db) GetPlaylist(name string) (Playlist, error)

func (*Db) GetPlaylists

func (d *Db) GetPlaylists() ([]Playlist, error)

func (*Db) InitMusic

func (d *Db) InitMusic() error

func (*Db) InitMusicPlaylist

func (d *Db) InitMusicPlaylist() error

relation ship

func (*Db) InitPlaylist

func (d *Db) InitPlaylist() error

func (*Db) RemoveMusicFromPlaylist

func (d *Db) RemoveMusicFromPlaylist(
	playlistName string,
	musicName string,
) error

func (*Db) RemovePlaylist

func (d *Db) RemovePlaylist(name string) error

func (*Db) UpdateMusic

func (d *Db) UpdateMusic(
	name string,
	source string,
	key string,
	data []byte,
) error

type Music

type Music struct {
	Name   string
	Source string
	Key    string
	Data   []byte
	Hash   string
}

func (Music) GetHash

func (m Music) GetHash() string

type Playlist

type Playlist struct {
	Name string
}

Jump to

Keyboard shortcuts

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