fix: encode artist names
This commit is contained in:
parent
e8ceff6de9
commit
5abdeb193e
1 changed files with 1 additions and 1 deletions
|
@ -7,7 +7,7 @@ module.exports = async function () {
|
||||||
const date = parseInt(chart['weeklyartistchart']['@attr']['to']) * 1000
|
const date = parseInt(chart['weeklyartistchart']['@attr']['to']) * 1000
|
||||||
let content = 'My top artists for the week: '
|
let content = 'My top artists for the week: '
|
||||||
artists.forEach((artist, index) => {
|
artists.forEach((artist, index) => {
|
||||||
content += `${artist['name']} @ ${artist['playcount']} play${
|
content += `${encodeURIComponent(artist['name'])} @ ${artist['playcount']} play${
|
||||||
parseInt(artist['playcount']) > 1 ? 's' : ''
|
parseInt(artist['playcount']) > 1 ? 's' : ''
|
||||||
}`
|
}`
|
||||||
if (index !== artists.length - 1) content += ', '
|
if (index !== artists.length - 1) content += ', '
|
||||||
|
|
Reference in a new issue