From eec8d9c3d2eb052a6f0a86450c2e0ccb73c30d20 Mon Sep 17 00:00:00 2001 From: Jake Date: Tue, 17 Feb 2015 18:51:55 +0000 Subject: [PATCH] Fixed playlists ignoring the max song length check --- playlist.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/playlist.go b/playlist.go index 9fed006..33ea4e8 100644 --- a/playlist.go +++ b/playlist.go @@ -75,7 +75,12 @@ func NewPlaylist(user, id string) (*Playlist, error) { playlist: playlist, dontSkip: false, } - dj.queue.AddSong(newSong) + // Don't spam the chat if a playlist contains songs that are too long + if dj.conf.General.MaxSongDuration == 0 { + dj.queue.AddSong(newSong) + } else if duration <= dj.conf.General.MaxSongDuration { + dj.queue.AddSong(newSong) + } } return playlist, nil