From ddcf99aa034b3ad126032f3f33040d1e56b20e54 Mon Sep 17 00:00:00 2001 From: Cory Dransfeldt Date: Sat, 30 Mar 2024 16:33:04 -0700 Subject: [PATCH] chore: scrobbling --- api/music.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/api/music.js b/api/music.js index bd28f2d3..4fccd554 100644 --- a/api/music.js +++ b/api/music.js @@ -40,8 +40,15 @@ export default async (request) => { const windowData = await scrobbles.get('window', { type: 'json'}) scrobbleData.push(...windowData['data']) } + const artists = getStore('artists') + const artistData = await artists.list() - return new Response(JSON.stringify({ data: scrobbleData }), + console.log(artistData) + + return new Response(JSON.stringify({ data: { + scrobbles: scrobbleData, + artists: artistData, + } }), { headers: { "Content-Type": "application/json" } } ) }