feat: search rym if no mbid

This commit is contained in:
Cory Dransfeldt 2023-07-30 14:50:31 -07:00
parent 3c4314be12
commit e5efabeec4
No known key found for this signature in database
2 changed files with 6 additions and 2 deletions

View file

@ -23,7 +23,9 @@ module.exports = async function () {
: `https://cdn.coryd.dev/albums/${album['name'].name
.replace(/\s+/g, '-')
.toLowerCase()}.jpg`,
url: `https://musicbrainz.org/album/${album['mbid']}`,
url: album['mbid']
? `https://musicbrainz.org/album/${album['mbid']}`
: `https://rateyourmusic.com/search?searchtype=l&searchterm=${encodeURI(album['name'])}`,
}
})
}

View file

@ -16,7 +16,9 @@ module.exports = async function () {
image:
`https://cdn.coryd.dev/artists/${artist['name'].replace(/\s+/g, '-').toLowerCase()}.jpg` ||
'https://cdn.coryd.dev/artists/missing-artist.jpg',
url: `https://musicbrainz.org/artist/${artist['mbid']}`,
url: artist['mbid']
? `https://musicbrainz.org/artist/${artist['mbid']}`
: `https://rateyourmusic.com/search?searchterm=${encodeURI(artist['name'])}`,
}
})
}