chore: scrobbling

This commit is contained in:
Cory Dransfeldt 2024-03-30 16:41:02 -07:00
parent d61b08dfd6
commit 006255d642
No known key found for this signature in database
2 changed files with 4 additions and 5 deletions

View file

@ -34,10 +34,10 @@ export const buildChart = (tracks) => {
tracksData[track['track']]++
}
if (!artistsData[track['artist']]) {
artistsData[track['artist']] = 1
if (!artistsData[artistCapitalization(track['artist'])]) {
artistsData[artistCapitalization(track['artist'])] = 1
} else {
artistsData[track['artist']]++
artistsData[artistCapitalization(track['artist'])]++
}
if (!albumsData[track['album']]) {

View file

@ -1,5 +1,5 @@
import EleventyFetch from '@11ty/eleventy-fetch';
import { artistCapitalization, buildChart } from './helpers/music.js'
import { buildChart } from './helpers/music.js'
export default async function () {
const API_KEY_MUSIC = process.env.API_KEY_MUSIC;
@ -9,6 +9,5 @@ export default async function () {
type: 'json',
}).catch();
const resObj = await res;
console.log(buildChart(resObj['data']))
return buildChart(resObj['data'])
}