fix bug that messes with counts

This commit is contained in:
Niko Storni 2020-09-25 21:44:14 +02:00
parent 070dda8739
commit 53e0b7c47b

View file

@ -29,13 +29,13 @@ func GetPlaylistVideoIDs(channelName string, maxVideos int, stopChan stop.Chan,
if err != nil { if err != nil {
return nil, errors.Err(err) return nil, errors.Err(err)
} }
videoIDs := make([]string, maxVideos) videoIDs := make([]string, 0, maxVideos)
for i, v := range ids { for i, v := range ids {
logrus.Debugf("%d - video id %s", i, v) logrus.Debugf("%d - video id %s", i, v)
if i >= maxVideos { if i >= maxVideos {
break break
} }
videoIDs[i] = v videoIDs = append(videoIDs, v)
} }
return videoIDs, nil return videoIDs, nil
} }