Fixed spotify playlist 20 entries limit
This commit is contained in:
@@ -18,7 +18,8 @@ const handler = (req, res) => __awaiter(void 0, void 0, void 0, function* () {
|
||||
const username = req.query.spotifyUser;
|
||||
data = [];
|
||||
let playlists = yield sp.getUserPlaylists(username);
|
||||
let playlistList = playlists.body.items;
|
||||
playlists = playlists.body;
|
||||
let playlistList = playlists.items;
|
||||
while (playlists.next) {
|
||||
const regExec = /offset=(\d+)&limit=(\d+)/g.exec(playlists.next);
|
||||
const offset = regExec[1];
|
||||
|
||||
@@ -11,7 +11,8 @@ const handler: ApiHandler['handler'] = async (req, res) => {
|
||||
const username = req.query.spotifyUser
|
||||
data = []
|
||||
let playlists = await sp.getUserPlaylists(username)
|
||||
let playlistList = playlists.body.items
|
||||
playlists = playlists.body
|
||||
let playlistList = playlists.items
|
||||
while (playlists.next) {
|
||||
const regExec = /offset=(\d+)&limit=(\d+)/g.exec(playlists.next)
|
||||
const offset = regExec![1]
|
||||
|
||||
Reference in New Issue
Block a user