fix: logic for artists w/no genre

This commit is contained in:
Cory Dransfeldt 2023-11-13 12:58:15 -08:00
parent 372f09517d
commit 7ea2d5d8a1

View file

@ -1,6 +1,5 @@
const emojiMap = (genre, artist) => {
const DEFAULT = '🎧'
if (!genre) return DEFAULT // early return for bad input
if (artist === 'David Bowie') return '👨🏻‍🎤'
if (artist === 'Minor Threat') return '👨🏻‍🦲'
if (artist === 'Bruce Springsteen') return '🇺🇸'
@ -9,6 +8,9 @@ const emojiMap = (genre, artist) => {
// mbid mismatches
if (artist === 'Ghastly') return '💀'
// early return for bad input
if (!genre) return DEFAULT
if (genre.includes('death metal')) return '💀'
if (genre.includes('black metal')) return '🪦'
if (genre.includes('metal')) return '🤘'