Merge pull request #123 from GabrielPlassard/master
Display the songtitle when the audio download fails #120
This commit is contained in:
commit
f2cb0e7d5a
|
@ -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
|
||||
|
|
|
@ -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()
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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."
|
||||
|
|
Reference in a new issue