Merge pull request #106 from HowIChrgeLazer/master
Added AnnounceNewTrack config bool
This commit is contained in:
commit
32beab0856
|
@ -34,6 +34,10 @@ MaxSongPerPlaylist = 50
|
||||||
# Default Value: false
|
# Default Value: false
|
||||||
AutomaticShuffleOn = false
|
AutomaticShuffleOn = false
|
||||||
|
|
||||||
|
# Announce song information at start of track
|
||||||
|
# Default Value: true
|
||||||
|
AnnounceNewTrack = true
|
||||||
|
|
||||||
[Cache]
|
[Cache]
|
||||||
|
|
||||||
# Cache songs as they are downloaded?
|
# Cache songs as they are downloaded?
|
||||||
|
|
|
@ -24,6 +24,7 @@ type DjConfig struct {
|
||||||
MaxSongDuration int
|
MaxSongDuration int
|
||||||
MaxSongPerPlaylist int
|
MaxSongPerPlaylist int
|
||||||
AutomaticShuffleOn bool
|
AutomaticShuffleOn bool
|
||||||
|
AnnounceNewTrack bool
|
||||||
}
|
}
|
||||||
Cache struct {
|
Cache struct {
|
||||||
Enabled bool
|
Enabled bool
|
||||||
|
|
|
@ -91,8 +91,9 @@ func (dl *AudioTrack) Play() {
|
||||||
if !isNil(dl.playlist) {
|
if !isNil(dl.playlist) {
|
||||||
message = fmt.Sprintf(message+`<tr><td align="center">From playlist "%s"</td></tr>`, dl.Playlist().Title())
|
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() {
|
go func() {
|
||||||
dj.audioStream.Wait()
|
dj.audioStream.Wait()
|
||||||
dj.queue.OnSongFinished()
|
dj.queue.OnSongFinished()
|
||||||
|
|
Reference in a new issue