chore: debug
This commit is contained in:
parent
523e41a92c
commit
64b442f615
1 changed files with 2 additions and 2 deletions
|
@ -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))
|
||||||
|
|
Reference in a new issue