From 783495d248e8082c97338d1061c0403eba690a4f Mon Sep 17 00:00:00 2001 From: Cory Dransfeldt Date: Fri, 29 Mar 2024 11:22:57 -0700 Subject: [PATCH] chore: debug --- api/scrobble.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/api/scrobble.js b/api/scrobble.js index c0b39a97..6e35acd8 100644 --- a/api/scrobble.js +++ b/api/scrobble.js @@ -13,9 +13,7 @@ export default async (request, context) => { const data = await request.formData() const payload = data.get('payload') console.log(payload) - const artist = payload['Metadata']['grandparentTitle'] - const album = payload['Metadata']['parentTitle'] - const track = payload['Metadata']['title'] + console.log(payload['Metadata']) const artists = getStore('artists') @@ -36,6 +34,9 @@ export default async (request, context) => { if (payload?.event === 'media.scrobble') { + const artist = payload['Metadata']['grandparentTitle'] + const album = payload['Metadata']['parentTitle'] + const track = payload['Metadata']['title'] const artistKey = sanitizeMediaString(artist).replace(/\s+/g, '-').toLowerCase() const artistInfo = await artists.getJSON(artistKey) if (!artistInfo) {