From e9c16f8fbefa12d5bd742d0c7a2f1a70dd55d94d Mon Sep 17 00:00:00 2001 From: Cory Dransfeldt Date: Sat, 30 Mar 2024 15:58:16 -0700 Subject: [PATCH] chore: scrobbling --- api/music.js | 6 +++--- src/_data/music.js | 0 2 files changed, 3 insertions(+), 3 deletions(-) create mode 100644 src/_data/music.js 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