From e24fc33f60efdb62f5894e1ae0224b03ceb32786 Mon Sep 17 00:00:00 2001 From: David Howden Date: Thu, 14 Sep 2017 08:55:56 +1000 Subject: [PATCH] Fix Format and FileType enumerations, and incorrect Format() for OGG. --- tag.go | 26 +++++++++++++------------- vorbis.go | 2 +- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/tag.go b/tag.go index 8e5afbc..1e2f97a 100644 --- a/tag.go +++ b/tag.go @@ -69,12 +69,12 @@ type Format string // Supported tag formats. const ( UnknownFormat Format = "" // Unknown Format. - ID3v1 = "ID3v1" // ID3v1 tag format. - ID3v2_2 = "ID3v2.2" // ID3v2.2 tag format. - ID3v2_3 = "ID3v2.3" // ID3v2.3 tag format (most common). - ID3v2_4 = "ID3v2.4" // ID3v2.4 tag format. - MP4 = "MP4" // MP4 tag (atom) format (see http://www.ftyps.com/ for a full file type list) - VORBIS = "VORBIS" // Vorbis Comment tag format. + ID3v1 Format = "ID3v1" // ID3v1 tag format. + ID3v2_2 Format = "ID3v2.2" // ID3v2.2 tag format. + ID3v2_3 Format = "ID3v2.3" // ID3v2.3 tag format (most common). + ID3v2_4 Format = "ID3v2.4" // ID3v2.4 tag format. + MP4 Format = "MP4" // MP4 tag (atom) format (see http://www.ftyps.com/ for a full file type list) + VORBIS Format = "VORBIS" // Vorbis Comment tag format. ) // FileType is an enumeration of the audio file types supported by this package, in particular @@ -85,13 +85,13 @@ type FileType string // Supported file types. const ( UnknownFileType FileType = "" // Unknown FileType. - MP3 = "MP3" // MP3 file - M4A = "M4A" // M4A file Apple iTunes (ACC) Audio - M4B = "M4B" // M4A file Apple iTunes (ACC) Audio Book - M4P = "M4P" // M4A file Apple iTunes (ACC) AES Protected Audio - ALAC = "ALAC" // Apple Lossless file FIXME: actually detect this - FLAC = "FLAC" // FLAC file - OGG = "OGG" // OGG file + MP3 FileType = "MP3" // MP3 file + M4A FileType = "M4A" // M4A file Apple iTunes (ACC) Audio + M4B FileType = "M4B" // M4A file Apple iTunes (ACC) Audio Book + M4P FileType = "M4P" // M4A file Apple iTunes (ACC) AES Protected Audio + ALAC FileType = "ALAC" // Apple Lossless file FIXME: actually detect this + FLAC FileType = "FLAC" // FLAC file + OGG FileType = "OGG" // OGG file ) // Metadata is an interface which is used to describe metadata retrieved by this package. diff --git a/vorbis.go b/vorbis.go index b395167..75a9349 100644 --- a/vorbis.go +++ b/vorbis.go @@ -145,7 +145,7 @@ func parseComment(c string) (k, v string, err error) { } func (m *metadataVorbis) Format() Format { - return FLAC + return VORBIS } func (m *metadataVorbis) Raw() map[string]interface{} {