Fixing build issues

This commit is contained in:
MichaelOultram 2015-07-28 21:40:44 +01:00
parent a1f2066532
commit fb9f9cc418
2 changed files with 7 additions and 5 deletions

View file

@ -8,7 +8,8 @@
package main package main
import ( import (
"fmt" "errors"
"github.com/layeh/gumble/gumble" "github.com/layeh/gumble/gumble"
) )
@ -63,9 +64,11 @@ func findServiceAndAdd(user *gumble.User, url string) (string, error) {
} }
if urlService == nil { if urlService == nil {
return nil, errors.New("INVALID_URL") return "", errors.New("INVALID_URL")
} else { } else {
oldLength := dj.queue.Len() oldLength := dj.queue.Len()
var title string
var err error
if title, err := urlService.NewRequest(user, url); err == nil { if title, err := urlService.NewRequest(user, url); err == nil {
// Starts playing the new song if nothing else is playing // Starts playing the new song if nothing else is playing
@ -75,7 +78,7 @@ func findServiceAndAdd(user *gumble.User, url string) (string, error) {
} else { } else {
dj.queue.CurrentSong().Delete() dj.queue.CurrentSong().Delete()
dj.queue.OnSongFinished() dj.queue.OnSongFinished()
return nil, errors.New("FAILED_TO_DOWNLOAD") return "", errors.New("FAILED_TO_DOWNLOAD")
} }
} }
} }

3
web.go
View file

@ -5,7 +5,6 @@ import (
"io/ioutil" "io/ioutil"
"math/rand" "math/rand"
"net/http" "net/http"
"html"
"strings" "strings"
"time" "time"
@ -38,7 +37,7 @@ func addSong(w http.ResponseWriter, r *http.Request) {
fmt.Fprintf(w, "Invalid Token") fmt.Fprintf(w, "Invalid Token")
} else { } else {
var url = UnescapeString(r.FormValue("url")) var url = UnescapeString(r.FormValue("url"))
} }
} }