From c1f89fbaaf3f074a1b4ffe9a121398a3ef44e2f1 Mon Sep 17 00:00:00 2001 From: Gabriel Plassard Date: Fri, 16 Oct 2015 23:15:33 +0200 Subject: [PATCH] Support MaxSongPerPlaylist configuration for soundcloud playlists --- service_soundcloud.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/service_soundcloud.go b/service_soundcloud.go index 4fd85bb..bb2adb7 100644 --- a/service_soundcloud.go +++ b/service_soundcloud.go @@ -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 {