Documentation
¶
Index ¶
- Constants
- func ComputeChecksum(filepath string) (string, error)
- func Contains[T comparable](s []T, e T) bool
- func Filter[T any](ss []T, test func(T) bool) (ret []T)
- func Fmap[T, U any](ts []T, f func(T, int) U) []U
- func GetFileAcousticFingerprint(filepath string) (string, error)
- func IsNumeric(s string) bool
- func PrettifyValidationError(validationsErrs error, prefix string) []error
- func SanitizeAndValidateMetadata(m *Metadata) []error
- type Fingerprint
- type IllustrationLocation
- type Lyrics
- type Metadata
- type PlainLyrics
- type SyncedLyric
- type SyncedLyrics
- type TrackType
Constants ¶
View Source
const CompilationKeyword = "compilations"
!! Changing this value is a breaking change !!
Variables ¶
This section is empty.
Functions ¶
func ComputeChecksum ¶
func Contains ¶
func Contains[T comparable](s []T, e T) bool
func PrettifyValidationError ¶
Parameters should be the returned error from validator.New().Struct(..) prefix will be added at the beginning of every returned errors
Types ¶
type Fingerprint ¶
type Fingerprint struct {
Fingerprint string `json:"fingerprint"`
}
type IllustrationLocation ¶
type IllustrationLocation string
const ( Embedded IllustrationLocation = "Embedded" Inline IllustrationLocation = "Inline" )
type Lyrics ¶
type Lyrics interface {
// contains filtered or unexported methods
}
func ParseLyrics ¶
type Metadata ¶
type Metadata struct {
// True if the track is from a compilation album
IsCompilation bool
// Name of the artist of the track
Artist string `validate:"required"`
// Sort Name of the artist of the track
SortArtist string
// Name of the artist of the parent album
AlbumArtist string
// Sort Name of the album artist
SortAlbumArtist string
// Plain Lyrics of the song. One string == one line. Empty lines are line jumps
PlainLyrics PlainLyrics
SyncedLyrics SyncedLyrics
// Name of the album of the track
Album string
// Sort name of the album
SortAlbum string
// Name of the release of the track
Release string
// Name of the track
Name string `validate:"required"`
// Sort name of the track
SortName string
// Release date of the album
AlbumReleaseDate *time.Time
// Release date of the release
ReleaseReleaseDate *time.Time
// Index of the track on the disc
Index int64
// Index of the disc the track is on
DiscIndex int64
// Name of the disc
DiscName string
// Bitrate of the file, in kbps
Bitrate int64 `validate:"gte=0"`
Bpm float64
// Duration, in seconds
Duration int64 `validate:"gte=0"`
// Type of the track
Type TrackType `validate:"required"`
// Genres of the track
Genres []string
// Discogs ID of the parent release
DiscogsId string
// Name of the label that published thed release
Label string
IllustrationLocation IllustrationLocation
IllustrationStreamIndex int
IllustrationPath string
RegistrationDate time.Time `validate:"required"`
Checksum string `validate:"required"`
Path string `validate:"required"`
Fingerprint *string
}
type PlainLyrics ¶
type PlainLyrics []string
type SyncedLyric ¶
type SyncedLyrics ¶
type SyncedLyrics []SyncedLyric
func (SyncedLyrics) ToPlain ¶
func (l SyncedLyrics) ToPlain() PlainLyrics
Source Files
¶
Click to show internal directories.
Click to hide internal directories.