From 335c19aa816dc7de2e6a04210f94225efb75756b Mon Sep 17 00:00:00 2001 From: MichaelOultram Date: Mon, 3 Aug 2015 22:39:45 +0100 Subject: [PATCH] Fixing build errors --- service_soundcloud.go | 7 ++++--- web.go | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/service_soundcloud.go b/service_soundcloud.go index c6f5d71..7cd328a 100644 --- a/service_soundcloud.go +++ b/service_soundcloud.go @@ -4,6 +4,7 @@ import ( "errors" "fmt" "os" + "strconv" "github.com/jmoiron/jsonq" "github.com/layeh/gumble/gumble" @@ -100,14 +101,14 @@ func (sc SoundCloud) NewSong(user string, trackData *jsonq.JsonQuery, playlist P id: id, title: title, thumbnail: thumbnail, - submitter: user.Name, - duration: duration, + submitter: user, + duration: strconv.ParseInt(duration), playlist: playlist, skippers: make([]string, 0), dontSkip: false, } dj.queue.AddSong(song) - return title, nil + return title, nil } // ---------------- diff --git a/web.go b/web.go index e44ccbf..7608e2d 100644 --- a/web.go +++ b/web.go @@ -128,7 +128,7 @@ func (web *WebServer) skip(w http.ResponseWriter, r *http.Request) { func (web *WebServer) status(w http.ResponseWriter, r *http.Request) { var uname = web.token_client[r.FormValue("token")] if uname == nil { - fmt.Fprintf(w, string(json.MarshalIndent(&Status{true, "Invalid Token"}))) + fmt.Fprintf(w, string(json.Marshal(&Status{true, "Invalid Token"}))) } else { // Generate song queue var songsInQueue [dj.queue.Len()]SongInfo