From 1f1f0e0c62721c1b850b96e6a744fc87c7d66db2 Mon Sep 17 00:00:00 2001 From: Cory Dransfeldt Date: Fri, 29 Mar 2024 16:15:25 -0700 Subject: [PATCH] chore: scrobbling --- api/scrobble.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/api/scrobble.js b/api/scrobble.js index 6adbeacf..6df9136f 100644 --- a/api/scrobble.js +++ b/api/scrobble.js @@ -111,6 +111,10 @@ export default async (request) => { } const scrobbleData = await scrobbles.get(`${weekStop()}`, { type: 'json'}) const windowData = await scrobbles.get('window', { type: 'json'}) + console.log('### SCROBBLE START') + console.log(scrobbleData); + console.log('### WINDOW START') + console.log(windowData); await scrobbles.setJSON('now-playing', {...trackScrobbleData, ...{ url: `https://musicbrainz.org/artist/${artistInfo?.['mbid']}`}}) let scrobbleUpdate = scrobbleData let windowUpdate = windowData; @@ -119,6 +123,10 @@ export default async (request) => { if (windowData?.['data']) windowUpdate['data'].push(trackScrobbleData) if (!windowData?.['data']) windowUpdate = { data: [trackScrobbleData] } windowUpdate = { data: filterOldScrobbles(windowUpdate.data) } + console.log('### SCROBBLE SET') + console.log(scrobbleUpdate); + console.log('### WINDOW SET') + console.log(windowUpdate); await scrobbles.setJSON(`${weekStop()}`, scrobbleUpdate) await scrobbles.setJSON('window', windowUpdate) }