Fixing build issues
This commit is contained in:
parent
fb9f9cc418
commit
ad25f4bcc3
|
@ -72,7 +72,7 @@ func (y YouTube) NewRequest(user *gumble.User, url string) (string, error) {
|
|||
playlist, err := NewYouTubePlaylist(user.Name, shortURL)
|
||||
return playlist.Title(), err
|
||||
} else {
|
||||
return nil, errors.New("NO_PLAYLIST_PERMISSION")
|
||||
return "", errors.New("NO_PLAYLIST_PERMISSION")
|
||||
}
|
||||
} else {
|
||||
re = RegexpFromURL(url, youtubeVideoPatterns)
|
||||
|
@ -85,7 +85,7 @@ func (y YouTube) NewRequest(user *gumble.User, url string) (string, error) {
|
|||
return song.Title(), err
|
||||
}
|
||||
} else {
|
||||
return nil, err
|
||||
return "", err
|
||||
}
|
||||
}
|
||||
|
||||
|
|
8
web.go
8
web.go
|
@ -24,7 +24,7 @@ func Webserver() {
|
|||
|
||||
func homepage(w http.ResponseWriter, r *http.Request) {
|
||||
var uname = token_client[r.FormValue("token")]
|
||||
if uname == "" {
|
||||
if uname == nil {
|
||||
fmt.Fprintf(w, "Invalid Token")
|
||||
} else {
|
||||
fmt.Fprintf(w, "Hang in there %s, I haven't made the website yet!", uname.Name)
|
||||
|
@ -33,7 +33,7 @@ func homepage(w http.ResponseWriter, r *http.Request) {
|
|||
|
||||
func addSong(w http.ResponseWriter, r *http.Request) {
|
||||
var uname = token_client[r.FormValue("token")]
|
||||
if uname == "" {
|
||||
if uname == nil {
|
||||
fmt.Fprintf(w, "Invalid Token")
|
||||
} else {
|
||||
var url = UnescapeString(r.FormValue("url"))
|
||||
|
@ -43,11 +43,11 @@ func addSong(w http.ResponseWriter, r *http.Request) {
|
|||
|
||||
func GetWebAddress(user *gumble.User) {
|
||||
if client_token[user] != "" {
|
||||
token_client[client_token[user]] = ""
|
||||
token_client[client_token[user]] = nil
|
||||
}
|
||||
// dealing with collisions
|
||||
var firstLoop = true
|
||||
for firstLoop || token_client[client_token[user]] != "" {
|
||||
for firstLoop || token_client[client_token[user]] != nil {
|
||||
client_token[user] = randSeq(10)
|
||||
firstLoop = false
|
||||
}
|
||||
|
|
Reference in a new issue