From b36cb3de37d8b32cbe01e87672251d9e22d434a3 Mon Sep 17 00:00:00 2001 From: MichaelOultram Date: Mon, 3 Aug 2015 22:51:38 +0100 Subject: [PATCH] Fixing build errors --- web.go | 12 +++++++----- youtube_dl.go | 18 +++++++++++++++++- 2 files changed, 24 insertions(+), 6 deletions(-) diff --git a/web.go b/web.go index 7608e2d..b3923f3 100644 --- a/web.go +++ b/web.go @@ -128,13 +128,15 @@ 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.Marshal(&Status{true, "Invalid Token"}))) + str, ok := json.Marshal(&Status{true, "Invalid Token"}).(string) + fmt.Fprintf(w, str) } else { // Generate song queue - var songsInQueue [dj.queue.Len()]SongInfo + queueLength := dj.queue.Len() + var songsInQueue [queueLength]SongInfo for i := 0; i < dj.queue.Len(); i++ { songItem := dj.queue.Get(i) - songs[i] = &SongInfo{ + songsInQueue[i] = &SongInfo{ TitleID: songItem.ID(), Title: songItem.Title(), Submitter: songItem.Submitter(), @@ -142,8 +144,8 @@ func (web *WebServer) status(w http.ResponseWriter, r *http.Request) { Thumbnail: songItem.Thumbnail(), } if !isNil(songItem.Playlist()) { - songs[i].PlaylistID = songItem.Playlist().ID() - songs[i].Playlist = songItem.Playlist().Title() + songsInQueuei].PlaylistID = songItem.Playlist().ID() + songsInQueue[i].Playlist = songItem.Playlist().Title() } } diff --git a/youtube_dl.go b/youtube_dl.go index d830eab..52245a2 100644 --- a/youtube_dl.go +++ b/youtube_dl.go @@ -1,6 +1,22 @@ package main -import () +import ( + "encoding/json" + "errors" + "fmt" + "io/ioutil" + "net/http" + "os" + "os/exec" + "regexp" + "strconv" + "strings" + "time" + + "github.com/jmoiron/jsonq" + "github.com/layeh/gumble/gumble" + "github.com/layeh/gumble/gumble_ffmpeg" +) type YouTubeDL struct { id string