diff --git a/id3v2.go b/id3v2.go index 894623d..d5b3b26 100644 --- a/id3v2.go +++ b/id3v2.go @@ -226,7 +226,7 @@ func readID3v2Frames(r io.Reader, h *ID3v2Header) (map[string]interface{}, error result[rawName] = txt case name == "UFID" || name == "UFI": - t, err := readUfid(b) + t, err := readUFID(b) if err != nil { return nil, err } diff --git a/id3v2frames.go b/id3v2frames.go index b1b7967..c0a8eac 100644 --- a/id3v2frames.go +++ b/id3v2frames.go @@ -195,21 +195,21 @@ func readTextWithDescrFrame(b []byte, hasLang bool, encoded bool) (*Comm, error) }, nil } -// UFID is composed of a provider (frequently an URL and a binary identifier) +// UFID is composed of a provider (frequently a URL and a binary identifier) // The identifier can be a text (Musicbrainz use texts, but not necessary) -type Ufid struct { +type UFID struct { Provider string Identifier []byte } -func (u Ufid) String() string { +func (u UFID) String() string { return fmt.Sprintf("%v (%v)", u.Provider, string(u.Identifier)) } -func readUfid(b []byte) (*Ufid, error) { +func readUFID(b []byte) (*UFID, error) { result := bytes.SplitN(b, []byte{0}, 2) - return &Ufid{ + return &UFID{ Provider: string(result[0]), Identifier: result[1], }, nil