Fixed spotify playlist 20 entries limit

This commit is contained in:
RemixDev 2021-06-27 11:50:00 +02:00
parent ea9d045075
commit 9b157c42bc
3 changed files with 8 additions and 6 deletions

View File

@ -18,7 +18,8 @@ const handler = (req, res) => __awaiter(void 0, void 0, void 0, function* () {
const username = req.query.spotifyUser; const username = req.query.spotifyUser;
data = []; data = [];
let playlists = yield sp.getUserPlaylists(username); let playlists = yield sp.getUserPlaylists(username);
let playlistList = playlists.body.items; playlists = playlists.body;
let playlistList = playlists.items;
while (playlists.next) { while (playlists.next) {
const regExec = /offset=(\d+)&limit=(\d+)/g.exec(playlists.next); const regExec = /offset=(\d+)&limit=(\d+)/g.exec(playlists.next);
const offset = regExec[1]; const offset = regExec[1];

View File

@ -11,7 +11,8 @@ const handler: ApiHandler['handler'] = async (req, res) => {
const username = req.query.spotifyUser const username = req.query.spotifyUser
data = [] data = []
let playlists = await sp.getUserPlaylists(username) let playlists = await sp.getUserPlaylists(username)
let playlistList = playlists.body.items playlists = playlists.body
let playlistList = playlists.items
while (playlists.next) { while (playlists.next) {
const regExec = /offset=(\d+)&limit=(\d+)/g.exec(playlists.next) const regExec = /offset=(\d+)&limit=(\d+)/g.exec(playlists.next)
const offset = regExec![1] const offset = regExec![1]

View File

@ -2269,10 +2269,10 @@ decompress-response@^6.0.0:
dependencies: dependencies:
mimic-response "^3.1.0" mimic-response "^3.1.0"
deemix@0.2.4: deemix@0.2.5:
version "0.2.4" version "0.2.5"
resolved "https://registry.yarnpkg.com/deemix/-/deemix-0.2.4.tgz#5e1a25ac712e8e4e0f3fe472b17382970284a9c0" resolved "https://registry.yarnpkg.com/deemix/-/deemix-0.2.5.tgz#d7e8c97de087d32b0030f3c0062a7e8ea6268ca6"
integrity sha512-U3wVShe3uzD0xSV1Cj8fbPYhN0XdaBOut0SWP0URIEGDjzNHX0RA4/WBJ4W7CbSi88zbpI/brDYQIoaf3q49lw== integrity sha512-BsxtCoXJ2wCxqiWEZYC6n+4wqr0Z6cpqqY6DgE4DGQGG6u+5shwew9/IGGtq47jAx1ysrJwz03FhdSnQTAXUTQ==
dependencies: dependencies:
async "^3.2.0" async "^3.2.0"
crypto "^1.0.1" crypto "^1.0.1"