From 27c0fc332f068e4187a1f8af897450b57afc6c44 Mon Sep 17 00:00:00 2001 From: Gabriel Plassard Date: Sun, 14 Feb 2016 16:01:48 +0100 Subject: [PATCH] Display the songtitle when the audio download fails #120 --- service.go | 3 ++- songqueue.go | 2 +- strings.go | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/service.go b/service.go index 02f9da5..1ca7af8 100644 --- a/service.go +++ b/service.go @@ -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 diff --git a/songqueue.go b/songqueue.go index 3fa0539..e723abe 100644 --- a/songqueue.go +++ b/songqueue.go @@ -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() } } diff --git a/strings.go b/strings.go index 0d6ea5b..75bce78 100644 --- a/strings.go +++ b/strings.go @@ -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. %s 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."