From 466d7dd6babcb567cc197f858a9d966679686086 Mon Sep 17 00:00:00 2001 From: Cory Dransfeldt Date: Thu, 4 Apr 2024 17:18:34 -0700 Subject: [PATCH] chore: pull month cart data --- src/_data/helpers/music.js | 2 +- src/_data/musicCharts.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/_data/helpers/music.js b/src/_data/helpers/music.js index fbb07770..71f6d2a6 100644 --- a/src/_data/helpers/music.js +++ b/src/_data/helpers/music.js @@ -4,7 +4,7 @@ export const artistCapitalization = (artist) => artistCapitalizationPatches[arti const sanitizeMediaString = (string) => string.normalize('NFD').replace(/[\u0300-\u036f\u2010—\.\?\(\)\[\]\{\}]/g, '').replace(/\.{3}/g, '').replace(/A©|é/g, 'e'); -export const buildChart = (tracks, artists, albums, nowPlaying) => { +export const buildChart = (tracks, artists, albums, nowPlaying = {}) => { const artistsData = {} const albumsData = {} const tracksData = {} diff --git a/src/_data/musicCharts.js b/src/_data/musicCharts.js index 652901aa..abfd5d22 100644 --- a/src/_data/musicCharts.js +++ b/src/_data/musicCharts.js @@ -5,8 +5,8 @@ export default async function () { const monthChart = JSON.parse(await readFile('./src/_data/json/scrobbles-month-chart.json', 'utf8')); const artists = JSON.parse(await readFile('./src/_data/json/artists-map.json', 'utf8')); const albums = JSON.parse(await readFile('./src/_data/json/albums-map.json', 'utf8')); - console.log(buildChart(monthChart['data'], artists, albums, nowPlaying)) + console.log(buildChart(monthChart['data'], artists, albums)) return { - month: buildChart(monthChart['data'], artists, albums, nowPlaying) + month: buildChart(monthChart['data'], artists, albums) } } \ No newline at end of file