diff --git a/playlist.go b/playlist.go index aec48eb..06cbfff 100644 --- a/playlist.go +++ b/playlist.go @@ -58,9 +58,9 @@ func NewPlaylist(user, id string) (*Playlist, error) { id: id, title: playlistTitle, } - + j := 0 for i := 0; i < playlistItems; i++ { - index := strconv.Itoa(i) + index := strconv.Itoa(j) songTitle, _ := jq.String("data", "items", index, "video", "title") songId, _ := jq.String("data", "items", index, "video", "id") songThumbnail, _ := jq.String("data", "items", index, "video", "thumbnail", "hqDefault") @@ -78,7 +78,8 @@ func NewPlaylist(user, id string) (*Playlist, error) { // Don't spam the chat if a playlist contains songs that are too long if dj.conf.General.MaxSongDuration == 0 || duration <= dj.conf.General.MaxSongDuration { dj.queue.AddSong(newSong) - } + j += 1 + } } return playlist, nil