fix: xml naming

This commit is contained in:
Cory Dransfeldt 2023-12-07 18:39:14 -08:00
parent 5abdeb193e
commit a4df253608

View file

@ -7,7 +7,8 @@ module.exports = async function () {
const date = parseInt(chart['weeklyartistchart']['@attr']['to']) * 1000
let content = 'My top artists for the week: '
artists.forEach((artist, index) => {
content += `${encodeURIComponent(artist['name'])} @ ${artist['playcount']} play${
const artistName = artist['name'].replace('&', '&');
content += `${artistName} @ ${artist['playcount']} play${
parseInt(artist['playcount']) > 1 ? 's' : ''
}`
if (index !== artists.length - 1) content += ', '