From cb1bc8432364c58f2ba0d7fd51fb63ad417c0251 Mon Sep 17 00:00:00 2001 From: Matthieu Grieger Date: Tue, 28 Jun 2016 21:31:19 -0700 Subject: [PATCH] Fix https://github.com/matthieugrieger/mumbledj/issues/161: Queue is now reset after disconnect --- CHANGELOG.md | 3 +++ bot/mumbledj.go | 1 + main.go | 2 +- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 48b4e05..e3cb6e4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,9 @@ MumbleDJ Changelog ================== +### June 28, 2016 -- `v3.0.9` +* Queue is now reset after disconnecting from the server to avoid unpredictable behavior. + ### June 26, 2016 -- `v3.0.8` * Fixed hang on setting `max_tracks_per_playlist` to a value larger than 50 (thanks [@mattikus](https://github.com/mattikus)). * Fixed full directory path not being created properly for config file (thanks [@DanielMarquard](https://github.com/DanielMarquard)). diff --git a/bot/mumbledj.go b/bot/mumbledj.go index 5a89926..a0e294a 100644 --- a/bot/mumbledj.go +++ b/bot/mumbledj.go @@ -80,6 +80,7 @@ func (dj *MumbleDJ) OnConnect(e *gumble.ConnectEvent) { // OnDisconnect event. Terminates MumbleDJ process or retries connection if // automatic connection retries are enabled. func (dj *MumbleDJ) OnDisconnect(e *gumble.DisconnectEvent) { + dj.Queue.Reset() if viper.GetBool("connection.retry_enabled") && (e.Type == gumble.DisconnectError || e.Type == gumble.DisconnectKicked) { logrus.WithFields(logrus.Fields{ diff --git a/main.go b/main.go index a05a36b..0c5ef85 100644 --- a/main.go +++ b/main.go @@ -32,7 +32,7 @@ func init() { services.DJ = DJ bot.DJ = DJ - DJ.Version = "v3.0.8" + DJ.Version = "v3.0.9" logrus.SetLevel(logrus.WarnLevel) }