feat: direct artist + album links

This commit is contained in:
Cory Dransfeldt 2023-07-16 09:07:58 -07:00
parent af001512fe
commit df32b17b43
No known key found for this signature in database
4 changed files with 8 additions and 5 deletions

View file

@ -10,7 +10,7 @@ const aliasArtists = (array) => {
}
const sanitizeAlbums = (array) => {
const denyList = /(\[|\()(Deluxe Edition|Special Edition|Remastered)(\]|\))/i;
const denyList = /(\[|\()(Deluxe Edition|Special Edition|Remastered)(\]|\))/i
array.forEach((a) => {
a.name = a.name.replace(denyList, '')
})
@ -51,7 +51,7 @@ module.exports = async function () {
while (CURRENT_PAGE < PAGES && hasNextPage) {
const URL = `https://api.music.apple.com/v1/me/recent/played/tracks?limit=${PAGE_SIZE}&offset=${
PAGE_SIZE * CURRENT_PAGE
}`
}&extend=album`
const tracks = await fetch(URL, {
headers: {
'Content-Type': 'application/json',
@ -81,6 +81,7 @@ module.exports = async function () {
name: track.attributes['albumName'],
artist: track.attributes['artistName'],
art: track.attributes.artwork.url.replace('{w}', '300').replace('{h}', '300'),
url: track.attributes.url,
plays: 1,
}
} else {