Display the songtitle when the audio download fails #120

This commit is contained in:
Gabriel Plassard 2016-02-14 16:01:48 +01:00
parent e14dc879a1
commit 27c0fc332f
3 changed files with 4 additions and 3 deletions

View file

@ -121,9 +121,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

@ -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

@ -60,7 +60,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."