Fixing build issues
This commit is contained in:
parent
a1f2066532
commit
fb9f9cc418
|
@ -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
3
web.go
|
@ -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"))
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Reference in a new issue