chore: debug
This commit is contained in:
parent
f024e8fbee
commit
2061696fe7
3 changed files with 23 additions and 0 deletions
19
plugins/fetch-scrobbles/index.js
Normal file
19
plugins/fetch-scrobbles/index.js
Normal file
|
@ -0,0 +1,19 @@
|
|||
import { getStore } from '@netlify/blobs'
|
||||
import fs from 'fs'
|
||||
|
||||
export const onPreBuild = async () => {
|
||||
const scrobbles = getStore('scrobbles')
|
||||
const artists = getStore('artists')
|
||||
const albums = getStore('albums')
|
||||
const windowData = await scrobbles.get('window', { type: 'json'})
|
||||
const artistsMap = await artists.get('artists-map', { type: 'json' })
|
||||
const albumsMap = await albums.get('albums-map', { type: 'json' })
|
||||
const nowPlaying = await scrobbles.get('now-playing', { type: 'json'})
|
||||
|
||||
console.log(windowData)
|
||||
|
||||
fs.writeFileSync('/src/_data/json/scrobbles-window.json', windowData)
|
||||
fs.writeFileSync('/src/_data/json/artists-map.json', artistsMap)
|
||||
fs.writeFileSync('/src/_data/json/albums-map.json', albumsMap)
|
||||
fs.writeFileSync('/src/_data/json/now-playing.json', nowPlaying)
|
||||
}
|
Reference in a new issue