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] date = &dates[0]
} }
genre, err := cmt.Get("GENRE")
if err != nil {
return nil, err
}
metadata := &Metadata{ metadata := &Metadata{
Title: title, Title: title,
Artist: artists, Artist: artists,
@@ -103,6 +108,7 @@ func readVorbisMetadata(file string) (*Metadata, error) {
Comment: comment, Comment: comment,
Date: date, Date: date,
ISRC: isrc, ISRC: isrc,
Genre: genre,
} }
commentToSpotifyid(metadata) commentToSpotifyid(metadata)
@@ -189,5 +195,9 @@ func createVorbisMetaBlock(m Metadata) flacvorbis.MetaDataBlockVorbisComment {
vorbisMeta.Add("SPOTIFY", *m.SpotifyID) vorbisMeta.Add("SPOTIFY", *m.SpotifyID)
} }
for _, genere := range m.Genre {
vorbisMeta.Add("GENRE", genere)
}
return *vorbisMeta return *vorbisMeta
} }