Files
vibesonic/internal/metadata/metadata.go
T

70 lines
1.8 KiB
Go

// Package metadata reads audio/video tags and technical properties via
// ffprobe. It shells out with an explicit argument list (never a shell),
// so filenames and tag content can never be interpreted as commands.
package metadata
// Tags holds the metadata VibeSonic understands, extracted from a single
// media file. Multi-value fields (Artists, Genres) are kept as slices
// rather than flattened into a single string, since a song can have
// several performers or genres.
type Tags struct {
Title string
SortTitle string
Album string
SortAlbum string
AlbumArtist string
SortAlbumArtist string
Artists []string // primary + featured performers, in credit order
Composer string
Conductor string
Contributors []Contributor // producer/engineer/remixer/etc.
Genres []string
Year int
OriginalYear int
ReleaseDate string
OriginalReleaseDate string
RecordLabel string
TrackNumber int
TrackTotal int
DiscNumber int
DiscTotal int
DiscSubtitle string
Comment string
ISRC string
BPM int
MusicBrainzTrackID string
MusicBrainzRecordingID string
MusicBrainzAlbumID string
MusicBrainzArtistID string
ReplayGainTrackGainDB *float64
ReplayGainTrackPeak *float64
ReplayGainAlbumGainDB *float64
ReplayGainAlbumPeak *float64
HasEmbeddedArt bool
EmbeddedArtStream int
EmbeddedLyrics string
// Technical properties, read from the container/stream info rather
// than tags.
Format string
Kind string // "song" or "video"
DurationSeconds float64
BitrateKbps int
SampleRateHz int
Channels int
}
// Contributor is a non-performer credit, e.g. {Name: "Rick Rubin", Role: "producer"}.
type Contributor struct {
Name string
Role string
}