Fixing build issues
This commit is contained in:
parent
cccb76d553
commit
90671fd1a5
1
Makefile
1
Makefile
|
@ -12,6 +12,7 @@ clean:
|
|||
install:
|
||||
mkdir -p ~/.mumbledj/config
|
||||
mkdir -p ~/.mumbledj/songs
|
||||
mkdir -p ~/.mumbledj/web
|
||||
if [ -a ~/.mumbledj/config/mumbledj.gcfg ]; then mv ~/.mumbledj/config/mumbledj.gcfg ~/.mumbledj/config/mumbledj_backup.gcfg; fi;
|
||||
cp -u config.gcfg ~/.mumbledj/config/mumbledj.gcfg
|
||||
if [ -d ~/bin ]; then cp -f mumbledj* ~/bin/mumbledj; else sudo cp -f mumbledj* /usr/local/bin/mumbledj; fi;
|
||||
|
|
|
@ -166,9 +166,10 @@ func parseCommand(user *gumble.User, username, command string) {
|
|||
|
||||
// add performs !add functionality. Checks input URL for service, and adds
|
||||
// the URL to the queue if the format matches.
|
||||
func add(user *gumble.User, url string) {
|
||||
func add(user *gumble.User, url string) error {
|
||||
if url == "" {
|
||||
dj.SendPrivateMessage(user, NO_ARGUMENT_MSG)
|
||||
return errors.New("NO_ARGUMENT")
|
||||
} else {
|
||||
title, err := findServiceAndAdd(user, url)
|
||||
if err == nil {
|
||||
|
@ -176,6 +177,7 @@ func add(user *gumble.User, url string) {
|
|||
} else {
|
||||
dj.SendPrivateMessage(user, err.Error())
|
||||
}
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
|
|
18
index.html
Normal file
18
index.html
Normal file
|
@ -0,0 +1,18 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="ISO-8859-1">
|
||||
<title>%s - mumbledj</title>
|
||||
<script type="text/javascript">
|
||||
function addURL(url) {
|
||||
|
||||
}
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Add Song Form</h1>
|
||||
<input type="text"/>
|
||||
<input type="button" value="Add Song" />
|
||||
</body>
|
||||
</html>
|
6
main.go
6
main.go
|
@ -102,7 +102,7 @@ func (dj *mumbledj) OnTextMessage(e *gumble.TextMessageEvent) {
|
|||
func (dj *mumbledj) OnUserChange(e *gumble.UserChangeEvent) {
|
||||
if e.Type.Has(gumble.UserChangeDisconnected) {
|
||||
if dj.audioStream.IsPlaying() {
|
||||
if dj.queue.CurrentSong().Playlist() != nil {
|
||||
if !isNull(dj.queue.CurrentSong().Playlist()) {
|
||||
dj.queue.CurrentSong().Playlist().RemoveSkip(e.User.Name)
|
||||
}
|
||||
dj.queue.CurrentSong().RemoveSkip(e.User.Name)
|
||||
|
@ -228,8 +228,8 @@ func main() {
|
|||
if err := dj.client.Connect(); err != nil {
|
||||
fmt.Printf("Could not connect to Mumble server at %s:%s.\n", address, port)
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Webserver()
|
||||
|
||||
<-dj.keepAlive
|
||||
|
|
Reference in a new issue