Browse Source

id3v1genres map is unexported now

main
Unbewohnte 3 years ago
parent
commit
2b145a211e
  1. 7
      id3v10.go
  2. 7
      id3v11.go
  3. 2
      id3v1genres.go

7
id3v10.go

@ -72,7 +72,10 @@ func GetID3v1Tags(rs io.ReadSeeker) (*ID3v1Tags, error) {
return nil, err
}
// genre is one byte by specification
genre := int(genreByte[0])
genre, exists := id3v1genres[int(genreByte[0])]
if !exists {
genre = ""
}
return &ID3v1Tags{
SongName: string(songname),
@ -80,7 +83,7 @@ func GetID3v1Tags(rs io.ReadSeeker) (*ID3v1Tags, error) {
Album: string(album),
Year: year,
Comment: string(comment),
Genre: ID3v1Genres[genre],
Genre: genre,
}, nil
}

7
id3v11.go

@ -83,7 +83,10 @@ func GetID3v11Tags(rs io.ReadSeeker) (*ID3v11Tags, error) {
return nil, err
}
// genre is one byte by specification
genre := int(genreByte[0])
genre, exists := id3v1genres[int(genreByte[0])]
if !exists {
genre = ""
}
return &ID3v11Tags{
SongName: string(songname),
@ -92,7 +95,7 @@ func GetID3v11Tags(rs io.ReadSeeker) (*ID3v11Tags, error) {
Year: year,
Comment: string(comment),
Track: track,
Genre: ID3v1Genres[genre],
Genre: genre,
}, nil
}

2
id3v1genres.go

@ -2,7 +2,7 @@ package id3ed
// https://en.wikipedia.org/wiki/List_of_ID3v1_Genres
var ID3v1Genres = map[int]string{
var id3v1genres = map[int]string{
0: "Blues",
1: "Classic Rock",
2: "Country",

Loading…
Cancel
Save