Increased to 50 song limit per playlist
This commit is contained in:
parent
61795cd0ad
commit
1309f53428
|
@ -405,14 +405,14 @@ func NewYouTubePlaylist(user, id string) (*YouTubePlaylist, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Retrieve items in playlist
|
// Retrieve items in playlist
|
||||||
url = fmt.Sprintf("https://www.googleapis.com/youtube/v3/playlistItems?part=snippet&maxResults=25&playlistId=%s&key=%s",
|
url = fmt.Sprintf("https://www.googleapis.com/youtube/v3/playlistItems?part=snippet&maxResults=50&playlistId=%s&key=%s",
|
||||||
id, os.Getenv("YOUTUBE_API_KEY"))
|
id, os.Getenv("YOUTUBE_API_KEY"))
|
||||||
if apiResponse, err = PerformGetRequest(url); err != nil {
|
if apiResponse, err = PerformGetRequest(url); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
numVideos, _ := apiResponse.Int("pageInfo", "totalResults")
|
numVideos, _ := apiResponse.Int("pageInfo", "totalResults")
|
||||||
if numVideos > 25 {
|
if numVideos > 50 {
|
||||||
numVideos = 25
|
numVideos = 50
|
||||||
}
|
}
|
||||||
|
|
||||||
for i := 0; i < numVideos; i++ {
|
for i := 0; i < numVideos; i++ {
|
||||||
|
|
Reference in a new issue