-
Notifications
You must be signed in to change notification settings - Fork 2
/
reader.go
51 lines (41 loc) · 1023 Bytes
/
reader.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
package mutago
// Title() returns the "TIT2" tag from the loaded tags.
func (m *Metadata) Title() (string, error) {
val, err := m.tagger.Get("TIT2")
if err != nil {
return "", err
}
return val, nil
}
// Album() returns the "TALB" tag from the loaded tags.
func (m *Metadata) Album() (string, error) {
val, err := m.tagger.Get("TALB")
if err != nil {
return "", err
}
return val, nil
}
// Artist() returns the "TPE1" tag from the loaded tags.
func (m *Metadata) Artist() (string, error) {
val, err := m.tagger.Get("TPE1")
if err != nil {
return "", err
}
return val, nil
}
// // Albumart() returns the "APIC" tag from the loaded tags.
// func (m *Metadata) Albumart() (*v2.Albumart, error) {
// val, err := m.tagger.Get("APIC")
// if err != nil {
// return "", err
// }
// return val, nil
// }
// Get() returns an arbitrary tag from the loaded tags.
func (m *Metadata) Get(tag string) (string, error) {
val, err := m.tagger.Get(tag)
if err != nil {
return "", err
}
return val, nil
}