diff --git a/id3v2.go b/id3v2.go index cb6c662..96382d0 100644 --- a/id3v2.go +++ b/id3v2.go @@ -340,10 +340,7 @@ func readID3v2Frames(r io.Reader, offset uint, h *id3v2Header) (map[string]inter result[rawName] = txt case name == "UFID" || name == "UFI": - t, err := readUFID(b) - if err != nil { - return nil, err - } + t := readUFID(b) result[rawName] = t case name == "WXXX" || name == "WXX": diff --git a/id3v2frames.go b/id3v2frames.go index 8397eba..83958a6 100644 --- a/id3v2frames.go +++ b/id3v2frames.go @@ -505,16 +505,18 @@ 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 { result := bytes.SplitN(b, singleZero, 2) if len(result) != 2 { - return nil, errors.New("expected to split UFID data into 2 pieces") + return &UFID{ + Identifier: result[0], + } } return &UFID{ Provider: string(result[0]), Identifier: result[1], - }, nil + } } var pictureTypes = map[byte]string{