support genre tag

This commit is contained in:
2026-06-10 16:42:38 +02:00
parent 0a7849ebfa
commit a02d32b3ca

View File

@@ -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
}