chore: debug

This commit is contained in:
Cory Dransfeldt 2024-04-04 17:08:29 -07:00
parent 523e41a92c
commit 64b442f615
No known key found for this signature in database

View file

@ -24,7 +24,7 @@ export const onPreBuild = async ({ constants }) => {
token: constants.NETLIFY_API_TOKEN, token: constants.NETLIFY_API_TOKEN,
}) })
const keys = getKeys() const keys = getKeys()
const chartData = [] const chartData = { data: [] }
const scrobbles = getStore('scrobbles') const scrobbles = getStore('scrobbles')
const artists = getStore('artists') const artists = getStore('artists')
const albums = getStore('albums') const albums = getStore('albums')
@ -34,7 +34,7 @@ export const onPreBuild = async ({ constants }) => {
const nowPlaying = await scrobbles.get('now-playing', { type: 'json'}) const nowPlaying = await scrobbles.get('now-playing', { type: 'json'})
for (const key of keys) { for (const key of keys) {
const scrobbleData = await scrobbles.get(key, { type: 'json'}) const scrobbleData = await scrobbles.get(key, { type: 'json'})
chartData.push(scrobbleData['data']) chartData['data'].push(...scrobbleData['data'])
} }
console.log(chartData) console.log(chartData)
fs.writeFileSync('./src/_data/json/scrobbles-window.json', JSON.stringify(windowData)) fs.writeFileSync('./src/_data/json/scrobbles-window.json', JSON.stringify(windowData))