From 64b442f615b8c59c87f70b5815eeb57ac362fbb4 Mon Sep 17 00:00:00 2001 From: Cory Dransfeldt Date: Thu, 4 Apr 2024 17:08:29 -0700 Subject: [PATCH] chore: debug --- plugins/fetch-scrobbles/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/fetch-scrobbles/index.js b/plugins/fetch-scrobbles/index.js index b1510484..caeb2986 100644 --- a/plugins/fetch-scrobbles/index.js +++ b/plugins/fetch-scrobbles/index.js @@ -24,7 +24,7 @@ export const onPreBuild = async ({ constants }) => { token: constants.NETLIFY_API_TOKEN, }) const keys = getKeys() - const chartData = [] + const chartData = { data: [] } const scrobbles = getStore('scrobbles') const artists = getStore('artists') const albums = getStore('albums') @@ -34,7 +34,7 @@ export const onPreBuild = async ({ constants }) => { const nowPlaying = await scrobbles.get('now-playing', { type: 'json'}) for (const key of keys) { const scrobbleData = await scrobbles.get(key, { type: 'json'}) - chartData.push(scrobbleData['data']) + chartData['data'].push(...scrobbleData['data']) } console.log(chartData) fs.writeFileSync('./src/_data/json/scrobbles-window.json', JSON.stringify(windowData))