Support MaxSongPerPlaylist configuration for soundcloud playlists
This commit is contained in:
parent
6776d6869f
commit
c1f89fbaaf
|
@ -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 {
|
||||
|
|
Reference in a new issue