Added Genre() to Metadata interface
This commit is contained in:
parent
ce0c1dc2f8
commit
8bdc82eff0
@ -16,6 +16,7 @@ Parsed metadata is exported via a single interface (giving a consistent API for
|
||||
Artist() string
|
||||
AlbumArtist() string
|
||||
Composer() string
|
||||
Genre() string
|
||||
Year() int
|
||||
|
||||
Track() (int, int) // Number, Total
|
||||
|
3
tag.go
3
tag.go
@ -100,6 +100,9 @@ type Metadata interface {
|
||||
// Year returns the year of the track.
|
||||
Year() int
|
||||
|
||||
// Genre returns the genre of the track.
|
||||
Genre() string
|
||||
|
||||
// Track returns the track number and total tracks, or zero values if unavailable.
|
||||
Track() (int, int)
|
||||
|
||||
|
@ -67,6 +67,7 @@ func printMetadata(m tag.Metadata) {
|
||||
fmt.Printf(" Album: %v\n", m.Album())
|
||||
fmt.Printf(" Artist: %v\n", m.Artist())
|
||||
fmt.Printf(" Composer: %v\n", m.Composer())
|
||||
fmt.Printf(" Genre: %v\n", m.Genre())
|
||||
fmt.Printf(" Year: %v\n", m.Year())
|
||||
|
||||
track, trackCount := m.Track()
|
||||
|
Loading…
Reference in New Issue
Block a user