From 57bfd37920a60af77c041cb5a56b524cb49db882 Mon Sep 17 00:00:00 2001 From: Cory Dransfeldt Date: Sat, 30 Mar 2024 17:15:22 -0700 Subject: [PATCH] chore: scrobbling --- api/scrobble.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/api/scrobble.js b/api/scrobble.js index 690d2b33..f3e31744 100644 --- a/api/scrobble.js +++ b/api/scrobble.js @@ -54,15 +54,12 @@ export default async (request) => { const track = payload['Metadata']['title'] const trackNumber = payload['Metadata']['index'] const timestamp = DateTime.now() - const artistKey = sanitizeMediaString(artist).replace(/\s+/g, '-').toLowerCase() - const albumKey = `${sanitizeMediaString(artist).replace(/\s+/g, '-').toLowerCase()}-${sanitizeMediaString(album).replace(/\s+/g, '-').toLowerCase()}` const artistsMap = await artists.get('artists-map', { type: 'json' }) const albumsMap = await albums.get('albums-map', { type: 'json' }) - let artistInfo = {} - let albumInfo = {} const artistSanitizedKey = `${sanitizeMediaString(artist).replace(/\s+/g, '-').toLowerCase()}` const albumSanitizedKey = `${sanitizeMediaString(artist).replace(/\s+/g, '-').toLowerCase()}-${sanitizeMediaString(album.replace(/[:\/\\,'']+/g , '').replace(/\s+/g, '-').toLowerCase())}` + let artistInfo = {} // if there is no artist blob, populate one if (!artistsMap[artistSanitizedKey]) {