diff options
| -rw-r--r-- | data.go | 7 | ||||
| -rw-r--r-- | modern.go | 5 |
2 files changed, 10 insertions, 2 deletions
@@ -87,7 +87,8 @@ func (store *SqlStore) GetPassword(name string) (string, error) { func (store *SqlStore) PutScrobbles(scrobbles []Scrobble) { for _, s := range scrobbles { - store.Exec("INSERT INTO scrobbles VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", + if _, err := store.Exec( + "INSERT INTO scrobbles VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", s.Artist, s.AlbumArtist, s.TrackName, @@ -98,6 +99,8 @@ func (store *SqlStore) PutScrobbles(scrobbles []Scrobble) { s.Chosen, s.Mbid, s.Session, - ) + ); err != nil { + fmt.Printf("error : %v\n", err) + } } } @@ -1,6 +1,7 @@ package main import ( + "database/sql/driver" "encoding/json" "encoding/xml" "fmt" @@ -42,6 +43,10 @@ type Correctable struct { Corrected int `xml:"corrected,attr" json:"corrected"` } +func (field Correctable) Value() (driver.Value, error) { + return field.Name, nil +} + func NewCorrectable(name string) Correctable { return Correctable{ Corrected: 0, |
