PrintAll method

This commit is contained in:
Dan Jones 2023-08-27 14:48:09 -05:00
commit 440b927141
3 changed files with 19 additions and 13 deletions

View file

@ -1,6 +1,9 @@
package mpd
import "github.com/fhs/gompd/v2/mpd"
import (
"fmt"
"github.com/fhs/gompd/v2/mpd"
)
type Song struct {
Path string
@ -29,3 +32,16 @@ func (s *Song) GetStickers() ([]mpd.Sticker, error) {
return s.stickers, err
}
func (s *Song) PrintAll(withStickers bool) {
for k, v := range s.Attrs {
fmt.Println(k, ":", v)
}
if withStickers {
sticks, _ := s.GetStickers()
for _, v := range sticks {
fmt.Println(v.Name, "*:", v.Value)
}
}
}