Documentation ¶
Overview ¶
Package freedb can parse freedb.org dumps and insert into PostgreSQL.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Shards = []string{
"blues",
"classical",
"country",
"data",
"folk",
"jazz",
"misc",
"newage",
"reggae",
"rock",
"soundtrack",
}
These shard names are meaningless and vestigal, but are needed to disambiguate the freedb.org DISCID
Functions ¶
func ComposeUID ¶
ComposeUID concatenates the non-unique DISCID with the unique shard number to create an actually unique ID.
Types ¶
type Disc ¶
type Disc struct { // IDs is a list of non-unique algorithmically-generated hashes identifying // a compact disc stored in hexadecimal. IDs [][]uint8 // Shard is an 8 bit unsigned int that represents the position of the shard // in the Shards slice. These shards look like genre subdirectories, but // that meaning is vestigal. The subdirectories are used as generic shard // buckets to work around ID collisions. Shard uint8 // Title is the combined artist name and release name of a compact disc. Title string // Genre is an optional field that represents the genre of music found // on a compact disc. Genre *string // Year is an optional field denoting the release year of a compact disc. Year *uint16 // Offsets are the positions on a CD where tracks begin. Offsets []uint32 // Duration of the compact disc, in seconds. Duration uint16 // Tracks is a slice of strings representing the track titles on a compact // disc. Tracks []string }
Disc represents the parsed output of a freeDB dump
func ParseDump ¶
ParseDump reads a freedb dump file, parses it, converts strings to UTF8, and returns the parsed data into a *freedb.Disc.
func (*Disc) AppendTitle ¶
AppendTitle appends to the string that represents the compact disc title, ensuring that the string is valid UTF8.
Click to show internal directories.
Click to hide internal directories.