Merge pull request #106 from HowIChrgeLazer/master

Added AnnounceNewTrack config bool
pull/107/head
Matthieu Grieger 2015-12-19 21:42:18 -08:00
commit 32beab0856
3 changed files with 8 additions and 2 deletions

View File

@ -34,6 +34,10 @@ MaxSongPerPlaylist = 50
# Default Value: false
AutomaticShuffleOn = false
# Announce song information at start of track
# Default Value: true
AnnounceNewTrack = true
[Cache]
# Cache songs as they are downloaded?

View File

@ -24,6 +24,7 @@ type DjConfig struct {
MaxSongDuration int
MaxSongPerPlaylist int
AutomaticShuffleOn bool
AnnounceNewTrack bool
}
Cache struct {
Enabled bool

View File

@ -91,8 +91,9 @@ func (dl *AudioTrack) Play() {
if !isNil(dl.playlist) {
message = fmt.Sprintf(message+`<tr><td align="center">From playlist "%s"</td></tr>`, dl.Playlist().Title())
}
dj.client.Self.Channel.Send(message+`</table>`, false)
if dj.conf.General.AnnounceNewTrack {
dj.client.Self.Channel.Send(message+`</table>`, false)
}
go func() {
dj.audioStream.Wait()
dj.queue.OnSongFinished()