meta

package
v0.0.0-...-5b2cea3 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2023 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrTagDefAmbiguous = errors.New("ambiguous tag definition")
	ErrInvalidTagType  = errors.New("invalid tag type")
	ErrDuplicatedTags  = errors.New("duplicated tags")
	ErrUndefinedTag    = errors.New("undefined tag")
)

Functions

func DBAvailable

func DBAvailable() bool

func GetTagGraph

func GetTagGraph() map[string][]string

func Init

func Init(path, url string) error

func ParseTagStr

func ParseTagStr(str string) (*string, string)

func Read

func Read(p string) error

Types

type AlbumDetails

type AlbumDetails struct {
	AlbumInfo
	Artists *Artists       `json:"artists,omitempty" toml:"artists"`
	Tags    []string       `json:"tags" toml:"tags"`
	Discs   []*DiscDetails `json:"discs" toml:"discs"`
}

func GetAlbumDetails

func GetAlbumDetails(id string) (AlbumDetails, bool)

func GetAlbums

func GetAlbums() []AlbumDetails

func GetAlbumsByTag

func GetAlbumsByTag(tag string, recursive bool) ([]AlbumDetails, bool)

func SearchAlbums

func SearchAlbums(keyword string) []AlbumDetails

type AlbumIdentifier

type AlbumIdentifier string

type AlbumInfo

type AlbumInfo struct {
	AlbumID AlbumIdentifier `json:"album_id" toml:"album_id"`
	Title   string          `json:"title" toml:"title"`
	Edition *string         `json:"edition,omitempty" toml:"edition"`
	Catalog string          `json:"catalog" toml:"catalog"`
	Artist  string          `json:"artist" toml:"artist"`
	Date    string          `json:"date" toml:"date"`
	Type    string          `json:"type" toml:"type"`
}

type Artists

type Artists map[string]string

type DiscDetails

type DiscDetails struct {
	DiscInfo
	Artists *Artists       `json:"artists,omitempty" toml:"artists"`
	Tags    []string       `json:"tags,omitempty" toml:"tags"`
	Tracks  []*TrackDetail `json:"tracks" toml:"tracks"`
}

type DiscIdentifier

type DiscIdentifier struct {
	AlbumID AlbumIdentifier `json:"album_id"  mapstructure:"album_id"`
	DiscID  uint            `json:"disc_id" mapstructure:"disc_id"`
}

type DiscInfo

type DiscInfo struct {
	Title   *string `json:"title,omitempty" toml:"title"`
	Artist  *string `json:"artist,omitempty" toml:"artist"`
	Catalog string  `json:"catalog" toml:"catalog"`
	Type    *string `json:"type,omitempty" toml:"type"`
}

type ExportedAlbumInfo

type ExportedAlbumInfo struct {
	AlbumInfo
	Discs []ExportedDiscInfo `json:"discs"`
}

func ExportAlbumInfo

func ExportAlbumInfo(album AlbumDetails) ExportedAlbumInfo

type ExportedDiscInfo

type ExportedDiscInfo struct {
	DiscInfo
	Tracks []*TrackInfo `json:"tracks"`
}

type ExportedPlaylist

type ExportedPlaylist struct {
	ExportedPlaylistInfo
	Tokens   []ExportedToken                       `json:"tokens"`
	Metadata map[AlbumIdentifier]ExportedAlbumInfo `json:"metadata"`
}

type ExportedPlaylistInfo

type ExportedPlaylistInfo struct {
	Name        string              `json:"name"`
	Description string              `json:"description"`
	Cover       *DiscIdentifier     `json:"cover"`
	Songs       []ExportedTrackList `json:"songs"`
}

type ExportedToken

type ExportedToken struct {
	Server string `json:"server"`
	Token  string `json:"token"`
}

type ExportedTrackList

type ExportedTrackList struct {
	DiscIdentifier
	Tracks []uint `json:"tracks"`
}

type Tag

type Tag struct {
	Name  string            `json:"name" toml:"name"`
	Type  string            `json:"type" toml:"type"`
	Names map[string]string `json:"names" toml:"names"`
	// contains filtered or unexported fields
}

func GetTags

func GetTags() []Tag

func TagFromStr

func TagFromStr(str string) (*Tag, error)

func (*Tag) AddAlbum

func (tag *Tag) AddAlbum(album *AlbumDetails)

func (*Tag) GetAlbums

func (tag *Tag) GetAlbums(recursive bool) []AlbumDetails

func (*Tag) Str

func (tag *Tag) Str() string

type TagSet

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

func NewTagSet

func NewTagSet(tagsIn []Tag) (*TagSet, error)

func (*TagSet) ExpandTagsDef

func (set *TagSet) ExpandTagsDef(album *AlbumDetails) error

func (*TagSet) FindTag

func (set *TagSet) FindTag(str string) (*Tag, error)

type TrackDetail

type TrackDetail struct {
	TrackInfo
	Artists *Artists `json:"artists,omitempty" toml:"artists"`
	Tags    []string `json:"tags,omitempty" toml:"tags"`
}

type TrackIdentifier

type TrackIdentifier struct {
	DiscIdentifier `mapstructure:",squash"`
	TrackID        uint `json:"track_id" mapstructure:"track_id"`
}

func (*TrackIdentifier) Scan

func (trackId *TrackIdentifier) Scan(src interface{}) error

func (TrackIdentifier) Value

func (trackId TrackIdentifier) Value() (driver.Value, error)

type TrackInfo

type TrackInfo struct {
	Title  string  `json:"title" toml:"title"`
	Artist *string `json:"artist,omitempty" toml:"artist"`
	Type   *string `json:"type,omitempty" toml:"type"`
}

type TrackInfoWithAlbum

type TrackInfoWithAlbum struct {
	TrackIdentifier
	TrackInfo
	AlbumTitle string `json:"album_title"`
}

func GetTrackInfo

func GetTrackInfo(id TrackIdentifier) TrackInfoWithAlbum

func SearchTracks

func SearchTracks(keyword string) []TrackInfoWithAlbum

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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