diff --git a/api/music.js b/api/music.js index 0fdd0da0..bd28f2d3 100644 --- a/api/music.js +++ b/api/music.js @@ -31,14 +31,14 @@ export default async (request) => { if (weeksArr.length > 0) { weeksArr.forEach(async (week) => { const weekData = await scrobbles.get(week, { type: 'json'}) - scrobbleData.push(weekData['data']) + scrobbleData.push(...weekData['data']) }) } else if (weeksString) { const weekData = await scrobbles.get(weeksString, { type: 'json'}) - scrobbleData.push(weekData['data']) + scrobbleData.push(...weekData['data']) } else { const windowData = await scrobbles.get('window', { type: 'json'}) - scrobbleData.push(windowData['data']) + scrobbleData.push(...windowData['data']) } return new Response(JSON.stringify({ data: scrobbleData }), diff --git a/src/_data/music.js b/src/_data/music.js new file mode 100644 index 00000000..e69de29b