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

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