diff --git a/.travis.yml b/.travis.yml index 8864edb..c832279 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,9 +10,26 @@ cache: - $HOME/gopath/src/github.com/MichaelOultram/mumbledj/.vendor before_script: +<<<<<<< HEAD - export PATH=$PATH:~/bin/ - export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:$HOME/opus/lib/pkgconfig - bash install-dependencies.sh install: - - ls -R $HOME/opus \ No newline at end of file + - ls -R $HOME/opus +======= + - export PATH=$PATH:$HOME/bin/ + - export LD_RUN_PATH=$LD_RUN_PATH:$HOME/opus/lib + - export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HOME/opus/lib + - export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:$HOME/opus/lib/pkgconfig + - bash install-dependencies.sh + +script: + - make + - make install + +after_success: + - ffmpeg -version + - youtube-dl --output ~/.mumbledj/songs/QcIy9NiNbmo.m4a --format m4a --prefer-ffmpeg -4 --verbose http://www.youtube.com/watch?v=QcIy9NiNbmo + - mumbledj -server=$MUMBLE_IP -port=$MUMBLE_PORT -username=travis -password=$MUMBLE_PASSWORD -verbose=true -test=true +>>>>>>> dev diff --git a/Makefile b/Makefile index 23a95e1..8c48293 100644 --- a/Makefile +++ b/Makefile @@ -13,7 +13,7 @@ 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; + if [ -f ~/.mumbledj/config/mumbledj.gcfg ]; then mv ~/.mumbledj/config/mumbledj.gcfg ~/.mumbledj/config/mumbledj_backup.gcfg; fi; cp -u config.gcfg ~/.mumbledj/config/mumbledj.gcfg cp -u index.html ~/.mumbledj/web/index.html if [ -d ~/bin ]; then cp -f mumbledj* ~/bin/mumbledj; else sudo cp -f mumbledj* /usr/local/bin/mumbledj; fi; diff --git a/README.md b/README.md index fd54ba5..a54d434 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -MumbleDJ [![Build Status](https://travis-ci.org/MichaelOultram/mumbledj.svg?branch=master)](https://travis-ci.org/MichaelOultram/mumbledj) +MumbleDJ [![Circle CI](https://circleci.com/gh/MichaelOultram/mumbledj/tree/master.svg?style=svg)](https://circleci.com/gh/MichaelOultram/mumbledj/tree/master) ======== **A Mumble bot that plays music fetched from YouTube videos.** diff --git a/circle.yml b/circle.yml new file mode 100644 index 0000000..936fb68 --- /dev/null +++ b/circle.yml @@ -0,0 +1,32 @@ +machine: + environment: + PATH: $HOME/bin/:$PATH + LD_RUN_PATH: $LD_RUN_PATH:$HOME/opus/lib + LD_LIBRARY_PATH: $LD_LIBRARY_PATH:$HOME/opus/lib + PKG_CONFIG_PATH: $PKG_CONFIG_PATH:$HOME/opus/lib/pkgconfig + +dependencies: + pre: + - ffmpeg -version + - sudo apt-get remove -y ffmpeg + - ffmpeg -version + - bash install-dependencies.sh + - ffmpeg -version + + override: + - make + - make install + + cache_directories: + - "~/opus" + - "~/bin" + - "~/mumbledj/.vendor" + - "/home/ubuntu/.go_workspace/bin" + - "/home/ubuntu/.go_workspace/pkg" + - "/home/ubuntu/.go_workspace/src/github.com/nitrous-io" + +test: + override: + - youtube-dl --output ~/.mumbledj/songs/QcIy9NiNbmo.m4a --format m4a --prefer-ffmpeg -v http://www.youtube.com/watch?v=QcIy9NiNbmo + - mumbledj -server=$MUMBLE_IP -port=$MUMBLE_PORT -username=circleci -password=$MUMBLE_PASSWORD -verbose=true -test=true: + timeout: 180 \ No newline at end of file diff --git a/commands.go b/commands.go index 5dde0c4..e0413cc 100644 --- a/commands.go +++ b/commands.go @@ -159,6 +159,13 @@ func parseCommand(user *gumble.User, username, command string) { } else { dj.SendPrivateMessage(user, NO_PERMISSION_MSG) } + // Test command (WORKAROUND) + case "test": + if dj.HasPermission(username, dj.conf.Permissions.AdminKill) { + test.testYoutubeSong() + } else { + dj.SendPrivateMessage(user, NO_PERMISSION_MSG) + } default: dj.SendPrivateMessage(user, COMMAND_DOESNT_EXIST_MSG) } @@ -171,7 +178,11 @@ func add(user *gumble.User, url string) error { dj.SendPrivateMessage(user, NO_ARGUMENT_MSG) return errors.New("NO_ARGUMENT") } else { - return findServiceAndAdd(user, url) + err := findServiceAndAdd(user, url) + if err != nil { + dj.SendPrivateMessage(user, err.Error()) + } + return err } } diff --git a/config.gcfg b/config.gcfg index 5c7a595..eea2750 100644 --- a/config.gcfg +++ b/config.gcfg @@ -144,7 +144,7 @@ AdminsEnabled = true # SYNTAX: In order to specify multiple admins, repeat the Admins="username" # line of code. Each line has one username, and an unlimited amount of usernames may # be entered in this matter. -Admins = "Matt" +Admins = "BottleOToast" # Make add an admin command? # DEFAULT VALUE: false diff --git a/index.html b/index.html index 9ef2b91..7bd1999 100644 --- a/index.html +++ b/index.html @@ -1,38 +1,49 @@ -
- -