Fixed playlists ignoring the max song length check

pull/42/head
Jake 2015-02-17 18:51:55 +00:00 committed by Jake
parent d37995b136
commit eec8d9c3d2
1 changed files with 6 additions and 1 deletions

View File

@ -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