Skip to content
This repository has been archived by the owner on Jan 20, 2021. It is now read-only.

Commit

Permalink
Merge pull request #106 from HowIChrgeLazer/master
Browse files Browse the repository at this point in the history
Added AnnounceNewTrack config bool
  • Loading branch information
matthieugrieger committed Dec 20, 2015
2 parents cd24a79 + d4ea58e commit 32beab0
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
4 changes: 4 additions & 0 deletions config.gcfg
Original file line number Diff line number Diff line change
Expand Up @@ -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?
Expand Down
1 change: 1 addition & 0 deletions parseconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ type DjConfig struct {
MaxSongDuration int
MaxSongPerPlaylist int
AutomaticShuffleOn bool
AnnounceNewTrack bool
}
Cache struct {
Enabled bool
Expand Down
5 changes: 3 additions & 2 deletions youtube_dl.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 32beab0

Please sign in to comment.