diff --git a/web.go b/web.go index 898b764..be5828c 100644 --- a/web.go +++ b/web.go @@ -72,6 +72,7 @@ func (web *WebServer) add(w http.ResponseWriter, r *http.Request) { fmt.Fprintf(w, "Invalid Token") } else { add(uname, html.UnescapeString(r.FormValue("value"))) + fmt.Fprintf(w, "Success") } } @@ -80,8 +81,9 @@ func (web *WebServer) volume(w http.ResponseWriter, r *http.Request) { if uname == nil { fmt.Fprintf(w, "Invalid Token") } else { - var volume = html.UnescapeString(r.FormValue("value")) - volume(uname, volume) + var vol = html.UnescapeString(r.FormValue("value")) + volume(uname, vol) + fmt.Fprintf(w, "Success") } } @@ -90,8 +92,14 @@ func (web *WebServer) skip(w http.ResponseWriter, r *http.Request) { if uname == nil { fmt.Fprintf(w, "Invalid Token") } else { - var playlist = html.UnescapeString(r.FormValue("value")) - skip(uname, false, playlist) + value = html.UnescapeString(r.FormValue("value")) + playlist, err := strconv.ParseBool(playlist) + if err == nil { + skip(uname, false, playlist) + fmt.Fprintf(w, "Success") + } else { + fmt.Fprintf(w, "Invalid Value") + } } }