Removed 2 song limit of playlist
This commit is contained in:
parent
87f70a7f8c
commit
dbed8d4569
|
@ -404,16 +404,16 @@ func NewYouTubePlaylist(user, id string) (*YouTubePlaylist, error) {
|
|||
title: title,
|
||||
}
|
||||
|
||||
// Retrieve items in playlist
|
||||
url = fmt.Sprintf("https://www.googleapis.com/youtube/v3/playlistItems?part=snippet&maxResults=2&playlistId=%s&key=%s",
|
||||
// Retrieve items in playlist &maxResults=25
|
||||
url = fmt.Sprintf("https://www.googleapis.com/youtube/v3/playlistItems?part=snippet&playlistId=%s&key=%s",
|
||||
id, os.Getenv("YOUTUBE_API_KEY"))
|
||||
if apiResponse, err = PerformGetRequest(url); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
numVideos, _ := apiResponse.Int("pageInfo", "totalResults")
|
||||
if numVideos > 2 {
|
||||
numVideos = 2
|
||||
}
|
||||
// if numVideos > 2 {
|
||||
// numVideos = 2
|
||||
// }
|
||||
|
||||
for i := 0; i < numVideos; i++ {
|
||||
index := strconv.Itoa(i)
|
||||
|
|
Reference in a new issue