From e5efabeec44ff71fbea25d3fe511f0b89d86a0e7 Mon Sep 17 00:00:00 2001 From: Cory Dransfeldt Date: Sun, 30 Jul 2023 14:50:31 -0700 Subject: [PATCH] feat: search rym if no mbid --- src/_data/albums.js | 4 +++- src/_data/artists.js | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/_data/albums.js b/src/_data/albums.js index ddf3eaff..9e7b833d 100644 --- a/src/_data/albums.js +++ b/src/_data/albums.js @@ -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'])}`, } }) } diff --git a/src/_data/artists.js b/src/_data/artists.js index 4ea27766..98f5caee 100644 --- a/src/_data/artists.js +++ b/src/_data/artists.js @@ -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'])}`, } }) }