n10v / id3v2

🎵 ID3 decoding and encoding library for Go
https://pkg.go.dev/github.com/bogem/id3v2/v2
MIT License
334 stars 50 forks source link

Add chapter picture frame #83

Open AbeEstrada opened 1 year ago

AbeEstrada commented 1 year ago

This allows to get the image from the chapter, useful for podcasts.

chapters := tag.GetFrames(tag.CommonID("Chapters"))
for _, f := range chapters {
    chapter, ok := f.(id3v2.ChapterFrame)
    if !ok {
        log.Fatal("Couldn't get chapter")
    }
    fmt.Println(chapter.Title.Text)
    fmt.Println(chapter.Artwork.MimeType)
    // If a chapter doesn't have an image, use the default artwork
}