chore: music api

This commit is contained in:
Cory Dransfeldt 2024-04-03 13:54:49 -07:00
parent 09f7478113
commit d9fdcad1f1
No known key found for this signature in database
2 changed files with 11 additions and 0 deletions

View file

@ -24,6 +24,7 @@ export default async (request) => {
const albums = getStore('albums')
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'})
if (week) {
const weekData = await scrobbles.get(week, { type: 'json'})
@ -35,6 +36,7 @@ export default async (request) => {
return new Response(JSON.stringify({
scrobbles: scrobbleData,
nowPlaying,
artists: artistsMap,
albums: albumsMap
}),