From befcd9f005b571ced38826a7d8bbc54cf72fe84a Mon Sep 17 00:00:00 2001 From: Cory Dransfeldt Date: Sat, 30 Mar 2024 17:11:22 -0700 Subject: [PATCH] chore: scrobbling --- api/scrobble.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/api/scrobble.js b/api/scrobble.js index dc873883..d194a1fc 100644 --- a/api/scrobble.js +++ b/api/scrobble.js @@ -108,7 +108,7 @@ export default async (request) => { image: `https://cdn.coryd.dev/artists/${sanitizeMediaString(artist).replace(/\s+/g, '-').toLowerCase()}.jpg` } artistInfo = artistObj - artistsMap[artist] = artistObj + artistsMap[`${sanitizeMediaString(artist).replace(/\s+/g, '-').toLowerCase()}`] = artistObj await artists.setJSON('artists-map', artistsMap) } @@ -132,7 +132,8 @@ export default async (request) => { image: `https://cdn.coryd.dev/albums/${sanitizeMediaString(artist).replace(/\s+/g, '-').toLowerCase()}-${sanitizeMediaString(album.replace(/[:\/\\,'']+/g , '').replace(/\s+/g, '-').toLowerCase())}.jpg` } - albumsMap[album] = albumObj + albumsMap[`${sanitizeMediaString(album.replace(/[:\/\\,'']+/g + , '').replace(/\s+/g, '-').toLowerCase())}`] = albumObj await albums.setJSON('albums-map', albumsMap) }