fix: reference

This commit is contained in:
Cory Dransfeldt 2024-04-07 11:59:39 -07:00
parent ca94df3b61
commit 45eb72e886
No known key found for this signature in database
3 changed files with 3 additions and 3 deletions

View file

@ -1,6 +1,6 @@
{
"name": "coryd.dev",
"version": "9.8.0",
"version": "9.8.1",
"description": "The source for my personal site. Built using 11ty.",
"type": "module",
"scripts": {

View file

@ -76,7 +76,7 @@ export const buildChart = (tracks, artists, albums, nowPlaying = {}) => {
}
}
export const buildTracksWithArt = (tracks, albums) => {
export const buildTracksWithArt = (tracks, artists, albums) => {
tracks.forEach(track => {
track['image'] = albums[albumSanitizedKey(track['album'])]?.['image'] || `https://cdn.coryd.dev/albums/${sanitizeMediaString(track['artist']).replace(/\s+/g, '-').toLowerCase()}-${sanitizeMediaString(track['album'].replace(/[:\/\\,'']+/g
, '').replace(/\s+/g, '-').toLowerCase())}.jpg`

View file

@ -8,7 +8,7 @@ export default async function () {
const albums = JSON.parse(await readFile('./src/_data/json/albums-map.json', 'utf8'));
const recent = JSON.parse(await readFile('./src/_data/json/scrobbles-window.json', 'utf8'))['data'].reverse().splice(0,10)
return {
recent: buildTracksWithArt(recent, albums),
recent: buildTracksWithArt(recent, artists, albums),
month: buildChart(monthChart['data'], artists, albums),
threeMonthChart: buildChart(threeMonthChart['data'], artists, albums),
}