Support MaxSongPerPlaylist configuration for soundcloud playlists

pull/91/head
Gabriel Plassard 2015-10-16 23:15:33 +02:00
parent 6776d6869f
commit c1f89fbaaf
1 changed files with 3 additions and 0 deletions

View File

@ -66,6 +66,9 @@ func (sc SoundCloud) NewRequest(user *gumble.User, url string) ([]Song, error) {
title: title,
}
if (dj.conf.General.MaxSongPerPlaylist > 0 && len(tracks) > dj.conf.General.MaxSongPerPlaylist){
tracks = tracks[:dj.conf.General.MaxSongPerPlaylist]
}
// Add all tracks
for _, t := range tracks {
if song, err := sc.NewSong(user, jsonq.NewQuery(t), 0, playlist); err == nil {