chore: debug

This commit is contained in:
Cory Dransfeldt 2024-04-03 18:49:58 -07:00
parent e60e548aa9
commit c2c6d00220
No known key found for this signature in database

View file

@ -1,16 +1,16 @@
import { getDeployStore } from '@netlify/blobs' import { getStore } from '@netlify/blobs'
import fs from 'fs' import fs from 'fs'
export const onPreBuild = async ({ constants }) => { export const onPreBuild = async ({ context }) => {
const scrobbles = store.get('scrobbles', { const scrobbles = getStore('scrobbles', {
siteID: constants.SITE_ID, siteID: constants.SITE_ID,
token: constants.NETLIFY_API_TOKEN, token: constants.NETLIFY_API_TOKEN,
}) })
const artists = store.get('artists', { const artists = getStore('artists', {
siteID: constants.SITE_ID, siteID: constants.SITE_ID,
token: constants.NETLIFY_API_TOKEN, token: constants.NETLIFY_API_TOKEN,
}) })
const albums = store.get('albums', { const albums = getStore('albums', {
siteID: constants.SITE_ID, siteID: constants.SITE_ID,
token: constants.NETLIFY_API_TOKEN, token: constants.NETLIFY_API_TOKEN,
}) })
@ -19,7 +19,8 @@ export const onPreBuild = async ({ constants }) => {
const albumsMap = await albums.get('albums-map', { type: 'json' }) const albumsMap = await albums.get('albums-map', { type: 'json' })
const nowPlaying = await scrobbles.get('now-playing', { type: 'json'}) const nowPlaying = await scrobbles.get('now-playing', { type: 'json'})
console.log(windowData) console.log(artistsMap)
console.log(albumsMap)
fs.writeFileSync('/src/_data/json/scrobbles-window.json', windowData) fs.writeFileSync('/src/_data/json/scrobbles-window.json', windowData)
fs.writeFileSync('/src/_data/json/artists-map.json', artistsMap) fs.writeFileSync('/src/_data/json/artists-map.json', artistsMap)