diff --git a/plugins/fetch-scrobbles/index.js b/plugins/fetch-scrobbles/index.js index 036cc306..aad6c74b 100644 --- a/plugins/fetch-scrobbles/index.js +++ b/plugins/fetch-scrobbles/index.js @@ -13,8 +13,8 @@ export const onPreBuild = async ({ constants }) => { 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'}) - fs.writeFileSync('../../src/_data/json/scrobbles-window.json', JSON.stringify(windowData)) - fs.writeFileSync('../../src/_data/json/artists-map.json', JSON.stringify(artistsMap)) - fs.writeFileSync('../../src/_data/json/albums-map.json', JSON.stringify(albumsMap)) - fs.writeFileSync('../../src/_data/json/now-playing.json', JSON.stringify(nowPlaying)) + fs.writeFileSync('./src/_data/json/scrobbles-window.json', JSON.stringify(windowData)) + fs.writeFileSync('./src/_data/json/artists-map.json', JSON.stringify(artistsMap)) + fs.writeFileSync('./src/_data/json/albums-map.json', JSON.stringify(albumsMap)) + fs.writeFileSync('./src/_data/json/now-playing.json', JSON.stringify(nowPlaying)) } \ No newline at end of file diff --git a/src/_data/test.js b/src/_data/test.js index 671347d4..e0806d64 100644 --- a/src/_data/test.js +++ b/src/_data/test.js @@ -1,13 +1,19 @@ import fs from 'fs' export default async function () { - const window = fs.readFileSync('./json/scrobbles-window.json', (error, data) => { - if (error) { - console.log(error); - return; - } - return JSON.parse(data) - }) - console.log(window) - return window + // const window = fs.readFileSync('./json/scrobbles-window.json', (error, data) => { + // if (error) { + // console.log(error); + // return; + // } + // return JSON.parse(data) + // }) + // console.log(window) + // return window + + fs.readdir('./json', (err, files) => { + files.forEach(file => { + console.log(file); + }); + }); }