fix: artist map lookups

This commit is contained in:
Cory Dransfeldt 2024-04-23 15:21:36 -07:00
parent 49acb63b13
commit 19ca2a5062
No known key found for this signature in database
2 changed files with 3 additions and 3 deletions

View file

@ -56,11 +56,11 @@ export default async (request) => {
artist,
trackNumber,
timestamp,
genre: artistsMap?.['genre'] || ''
genre: artistsMap[artistSanitizedKey(artist)]?.['genre'] || ''
}
const scrobbleData = await scrobbles.get(`${weekKey()}`, { type: 'json'})
const windowData = await scrobbles.get('window', { type: 'json'})
const artistUrl = (artistsMap?.['mbid'] && artistsMap?.['mbid'] !== '') ? `http://musicbrainz.org/artist/${artistsMap?.['mbid']}` : `https://musicbrainz.org/search?query=${artist.replace(
const artistUrl = (artistsMap[artistSanitizedKey(artist)]?.['mbid'] && artistsMap[artistSanitizedKey(artist)]?.['mbid'] !== '') ? `http://musicbrainz.org/artist/${artistsMap[artistSanitizedKey(artist)]?.['mbid']}` : `https://musicbrainz.org/search?query=${artist.replace(
/\s+/g,
'+'
)}&type=artist`

View file

@ -1,6 +1,6 @@
{
"name": "coryd.dev",
"version": "12.9.2",
"version": "12.9.3",
"description": "The source for my personal site. Built using 11ty.",
"type": "module",
"scripts": {