Merge branch 'master' into add_search

This commit is contained in:
Nikola Jovicic 2016-02-18 12:26:02 +01:00
commit c837068573
5 changed files with 12 additions and 5 deletions

View file

@ -1,6 +1,12 @@
MumbleDJ Changelog
==================
### February 14, 2016 -- `v2.8.15`
* Fixed an incorrectly formatted error message (thanks [@GabrielPlassard](https://github.com/GabrielPlassard)).
### February 12, 2016 -- `v2.8.14`
* Audio is now downloaded using the `bestaudio` format. This prevents situations in which some audio would not play because an `.m4a` file was not available (thanks [@mpacella88](https://github.com/mpacella88)).
### February 6, 2016 -- `v2.8.13`
* Added `!version` command to display the version of MumbleDJ that is running (thanks [@zeblau](https://github.com/zeblau)).
* Added `version` commandline argument to display the version of MumbleDJ that is running (thanks [@zeblau](https://github.com/zeblau)).

View file

@ -125,9 +125,10 @@ func FindServiceAndAdd(user *gumble.User, url string) error {
if err := dj.queue.CurrentSong().Download(); err == nil {
dj.queue.CurrentSong().Play()
} else {
var failMessage = fmt.Sprintf(AUDIO_FAIL_MSG, dj.queue.CurrentSong().Title())
dj.queue.CurrentSong().Delete()
dj.queue.OnSongFinished()
return errors.New(AUDIO_FAIL_MSG)
return errors.New(failMessage)
}
}
return nil

View file

@ -115,7 +115,7 @@ func (yt YouTube) NewSong(user *gumble.User, id, offset string, playlist Playlis
offset: int(yt.parseTime(offset, `T\=(?P<days>\d+D)?(?P<hours>\d+H)?(?P<minutes>\d+M)?(?P<seconds>\d+S)?`).Seconds()),
duration: int(yt.parseTime(duration, `P(?P<days>\d+D)?T(?P<hours>\d+H)?(?P<minutes>\d+M)?(?P<seconds>\d+S)?`).Seconds()),
thumbnail: thumbnail,
format: "m4a",
format: "bestaudio",
skippers: make([]string, 0),
playlist: playlist,
dontSkip: false,

View file

@ -118,7 +118,7 @@ func (q *SongQueue) PrepareAndPlayNextSong() {
if err := q.CurrentSong().Download(); err == nil {
q.CurrentSong().Play()
} else {
dj.client.Self.Channel.Send(AUDIO_FAIL_MSG, false)
dj.client.Self.Channel.Send(fmt.Sprintf(AUDIO_FAIL_MSG, q.CurrentSong().Title()), false)
q.OnSongFinished()
}
}

View file

@ -8,7 +8,7 @@
package main
// Current version of the bot
const VERSION = "v2.8.13"
const VERSION = "v2.8.15"
// Message shown to users when they request the version of the bot
const DJ_VERSION = "MumbleDJ <b>" + VERSION + "</b>"
@ -63,7 +63,7 @@ const ADMIN_SONG_SKIP_MSG = "An admin has decided to skip the current song."
const ADMIN_PLAYLIST_SKIP_MSG = "An admin has decided to skip the current playlist."
// Message shown to users when the audio for a video could not be downloaded.
const AUDIO_FAIL_MSG = "The audio download for this video failed. %s has likely not generated the audio files for this %s yet. Skipping to the next song!"
const AUDIO_FAIL_MSG = "The audio download for this video failed. <b>%s</b> has likely not generated the audio files for this track yet. Skipping to the next song!"
// Message shown to users when they supply an URL that does not contain a valid ID.
const INVALID_ID_MSG = "The %s URL you supplied did not contain a valid ID."