feat: dry up + normalize now page

This commit is contained in:
Cory Dransfeldt 2023-08-14 11:36:07 -07:00
parent 022ce82f81
commit 6dda493d7b
No known key found for this signature in database
13 changed files with 86 additions and 136 deletions

View file

@ -10,7 +10,7 @@ module.exports = async function () {
const data = await res
return data['topartists'].artist.map((artist) => {
return {
name: artist['name'],
title: artist['name'],
plays: artist['playcount'],
rank: artist['@attr']['rank'],
image:
@ -19,6 +19,7 @@ module.exports = async function () {
url: artist['mbid']
? `https://musicbrainz.org/artist/${artist['mbid']}`
: `https://musicbrainz.org/search?query=${encodeURI(artist['name'])}&type=artist`,
type: 'artist',
}
})
}