diff options
Diffstat (limited to 'modern.go')
| -rw-r--r-- | modern.go | 27 |
1 files changed, 20 insertions, 7 deletions
@@ -25,18 +25,31 @@ type Token struct { string } +type Attrs struct { + Accepted int `xml:"accepted,attr" json:"accepted"` + Ignored int `xml:"ignored,attr" json:"ignored"` +} + type Scrobbles struct { - XMLName xml.Name `xml:"scrobbles"` - Scrobbles []Scrobble + XMLName xml.Name `xml:"scrobbles" json:scrobbles"` + Scrobbles []Scrobble `xml:"scrobble" json:scrobble` + Attrs `json:"@attr"` } -type Scrobble struct { - Track Track `xml:"track"` +type Correctable struct { + Corrected int `xml:"corrected,attr" json:"corrected"` + Name string `xml:",chardata" json:"#text"` +} + +func NewCorrectable(name string) Correctable { + return Correctable{ + Corrected: 0, + Name: name, + } } -type Track struct { - Corrected int `xml:"corrected,attr"` - Name string `xml:",chardata"` +func (field *Correctable) String() string { + return field.Name } func (n Name) getName() string { |
