Fixing build issues

This commit is contained in:
MichaelOultram 2015-07-28 21:43:02 +01:00
parent fb9f9cc418
commit ad25f4bcc3
2 changed files with 6 additions and 6 deletions

View file

@ -72,7 +72,7 @@ func (y YouTube) NewRequest(user *gumble.User, url string) (string, error) {
playlist, err := NewYouTubePlaylist(user.Name, shortURL) playlist, err := NewYouTubePlaylist(user.Name, shortURL)
return playlist.Title(), err return playlist.Title(), err
} else { } else {
return nil, errors.New("NO_PLAYLIST_PERMISSION") return "", errors.New("NO_PLAYLIST_PERMISSION")
} }
} else { } else {
re = RegexpFromURL(url, youtubeVideoPatterns) re = RegexpFromURL(url, youtubeVideoPatterns)
@ -85,7 +85,7 @@ func (y YouTube) NewRequest(user *gumble.User, url string) (string, error) {
return song.Title(), err return song.Title(), err
} }
} else { } else {
return nil, err return "", err
} }
} }

8
web.go
View file

@ -24,7 +24,7 @@ func Webserver() {
func homepage(w http.ResponseWriter, r *http.Request) { func homepage(w http.ResponseWriter, r *http.Request) {
var uname = token_client[r.FormValue("token")] var uname = token_client[r.FormValue("token")]
if uname == "" { if uname == nil {
fmt.Fprintf(w, "Invalid Token") fmt.Fprintf(w, "Invalid Token")
} else { } else {
fmt.Fprintf(w, "Hang in there %s, I haven't made the website yet!", uname.Name) 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) { func addSong(w http.ResponseWriter, r *http.Request) {
var uname = token_client[r.FormValue("token")] var uname = token_client[r.FormValue("token")]
if uname == "" { if uname == nil {
fmt.Fprintf(w, "Invalid Token") fmt.Fprintf(w, "Invalid Token")
} else { } else {
var url = UnescapeString(r.FormValue("url")) var url = UnescapeString(r.FormValue("url"))
@ -43,11 +43,11 @@ func addSong(w http.ResponseWriter, r *http.Request) {
func GetWebAddress(user *gumble.User) { func GetWebAddress(user *gumble.User) {
if client_token[user] != "" { if client_token[user] != "" {
token_client[client_token[user]] = "" token_client[client_token[user]] = nil
} }
// dealing with collisions // dealing with collisions
var firstLoop = true var firstLoop = true
for firstLoop || token_client[client_token[user]] != "" { for firstLoop || token_client[client_token[user]] != nil {
client_token[user] = randSeq(10) client_token[user] = randSeq(10)
firstLoop = false firstLoop = false
} }