support genre tag
This commit is contained in:
@@ -95,6 +95,11 @@ func readVorbisMetadata(file string) (*Metadata, error) {
|
||||
date = &dates[0]
|
||||
}
|
||||
|
||||
genre, err := cmt.Get("GENRE")
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
metadata := &Metadata{
|
||||
Title: title,
|
||||
Artist: artists,
|
||||
@@ -103,6 +108,7 @@ func readVorbisMetadata(file string) (*Metadata, error) {
|
||||
Comment: comment,
|
||||
Date: date,
|
||||
ISRC: isrc,
|
||||
Genre: genre,
|
||||
}
|
||||
|
||||
commentToSpotifyid(metadata)
|
||||
@@ -189,5 +195,9 @@ func createVorbisMetaBlock(m Metadata) flacvorbis.MetaDataBlockVorbisComment {
|
||||
vorbisMeta.Add("SPOTIFY", *m.SpotifyID)
|
||||
}
|
||||
|
||||
for _, genere := range m.Genre {
|
||||
vorbisMeta.Add("GENRE", genere)
|
||||
}
|
||||
|
||||
return *vorbisMeta
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user