fix: that's just absurd. stop.
This commit is contained in:
parent
ce9611c828
commit
1a68888350
1 changed files with 12 additions and 2 deletions
|
@ -23,6 +23,14 @@ const artistAliases = {
|
|||
],
|
||||
}
|
||||
|
||||
const sanitizeTrack = (track) => {
|
||||
track.replace(
|
||||
'(2001 Version) [feat. Markus Johnsson, Thomas Einarsson, Tobias Gustavsson & Daniel Erlandsson] [2001]',
|
||||
''
|
||||
)
|
||||
return track
|
||||
}
|
||||
|
||||
const aliasArtist = (artist) => {
|
||||
const aliased = artistAliases.aliases.find((alias) => alias.aliases.includes(artist))
|
||||
if (aliased) artist = aliased.artist
|
||||
|
@ -91,8 +99,10 @@ export default async () => {
|
|||
: `https://musicbrainz.org/search?query=${track['artistName'].replace(/\s+/g, '+')}&type=artist`
|
||||
|
||||
return Response.json({
|
||||
text: `🎧 ${track['name']} by ${artist}`,
|
||||
html: `🎧 <a href="${trackUrl}">${track['name']}</a> by <a href="${artistUrl}">${artist}</a>`,
|
||||
text: `🎧 ${sanitizeTrack(track['name'])} by ${artist}`,
|
||||
html: `🎧 <a href="${trackUrl}">${sanitizeTrack(
|
||||
track['name']
|
||||
)}</a> by <a href="${artistUrl}">${artist}</a>`,
|
||||
})
|
||||
}
|
||||
|
||||
|
|
Reference in a new issue