Fixing build errors
This commit is contained in:
parent
a135b4fe4d
commit
b36cb3de37
12
web.go
12
web.go
|
@ -128,13 +128,15 @@ func (web *WebServer) skip(w http.ResponseWriter, r *http.Request) {
|
|||
func (web *WebServer) status(w http.ResponseWriter, r *http.Request) {
|
||||
var uname = web.token_client[r.FormValue("token")]
|
||||
if uname == nil {
|
||||
fmt.Fprintf(w, string(json.Marshal(&Status{true, "Invalid Token"})))
|
||||
str, ok := json.Marshal(&Status{true, "Invalid Token"}).(string)
|
||||
fmt.Fprintf(w, str)
|
||||
} else {
|
||||
// Generate song queue
|
||||
var songsInQueue [dj.queue.Len()]SongInfo
|
||||
queueLength := dj.queue.Len()
|
||||
var songsInQueue [queueLength]SongInfo
|
||||
for i := 0; i < dj.queue.Len(); i++ {
|
||||
songItem := dj.queue.Get(i)
|
||||
songs[i] = &SongInfo{
|
||||
songsInQueue[i] = &SongInfo{
|
||||
TitleID: songItem.ID(),
|
||||
Title: songItem.Title(),
|
||||
Submitter: songItem.Submitter(),
|
||||
|
@ -142,8 +144,8 @@ func (web *WebServer) status(w http.ResponseWriter, r *http.Request) {
|
|||
Thumbnail: songItem.Thumbnail(),
|
||||
}
|
||||
if !isNil(songItem.Playlist()) {
|
||||
songs[i].PlaylistID = songItem.Playlist().ID()
|
||||
songs[i].Playlist = songItem.Playlist().Title()
|
||||
songsInQueuei].PlaylistID = songItem.Playlist().ID()
|
||||
songsInQueue[i].Playlist = songItem.Playlist().Title()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,22 @@
|
|||
package main
|
||||
|
||||
import ()
|
||||
import (
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"net/http"
|
||||
"os"
|
||||
"os/exec"
|
||||
"regexp"
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/jmoiron/jsonq"
|
||||
"github.com/layeh/gumble/gumble"
|
||||
"github.com/layeh/gumble/gumble_ffmpeg"
|
||||
)
|
||||
|
||||
type YouTubeDL struct {
|
||||
id string
|
||||
|
|
Reference in a new issue