diff --git a/service.go b/service.go index 7c67733..551fc28 100644 --- a/service.go +++ b/service.go @@ -8,7 +8,8 @@ package main import ( - "fmt" + "errors" + "github.com/layeh/gumble/gumble" ) @@ -63,9 +64,11 @@ func findServiceAndAdd(user *gumble.User, url string) (string, error) { } if urlService == nil { - return nil, errors.New("INVALID_URL") + return "", errors.New("INVALID_URL") } else { oldLength := dj.queue.Len() + var title string + var err error if title, err := urlService.NewRequest(user, url); err == nil { // Starts playing the new song if nothing else is playing @@ -75,7 +78,7 @@ func findServiceAndAdd(user *gumble.User, url string) (string, error) { } else { dj.queue.CurrentSong().Delete() dj.queue.OnSongFinished() - return nil, errors.New("FAILED_TO_DOWNLOAD") + return "", errors.New("FAILED_TO_DOWNLOAD") } } } diff --git a/web.go b/web.go index b513255..cc392b2 100644 --- a/web.go +++ b/web.go @@ -5,7 +5,6 @@ import ( "io/ioutil" "math/rand" "net/http" - "html" "strings" "time" @@ -38,7 +37,7 @@ func addSong(w http.ResponseWriter, r *http.Request) { fmt.Fprintf(w, "Invalid Token") } else { var url = UnescapeString(r.FormValue("url")) - + } }