fix: internalize aliasing dependencies

This commit is contained in:
Cory Dransfeldt 2023-10-09 16:00:47 -07:00
parent a5c0d0daef
commit 8edecf908d

View file

@ -1,4 +1,29 @@
const { aliasArtist } = require('../../src/utils/media') const artistAliases = {
"aliases": [
{
"artist": "Aesop Rock",
"aliases": ["Aesop Rock & Homeboy Sandman", "Aesop Rock & Blockhead"]
},
{
"artist": "Fen",
"aliases": ["Sleepwalker & Fen"]
},
{
"artist": "Osees",
"aliases": ["OCS", "The Ohsees", "Thee Oh Sees", "Thee Oh See's"]
},
{
"artist": "Tom Waits",
"aliases": ["Tom Waits & Crystal Gayle", "Crystal Gayle"]
}
]
}
const aliasArtist = (artist) => {
const aliased = artistAliases.aliases.find((alias) => alias.aliases.includes(artist))
if (aliased) artist = aliased.artist
return artist
}
export default async () => { export default async () => {
// eslint-disable-next-line no-undef // eslint-disable-next-line no-undef