+
${albumArtFile ?
`

`:
'
'}
-
${name} ${year ? `
[${year}]` : ''}
+
${escapeHtml(name)} ${year ? `
[${year}]` : ''}
`;
}
function renderArtist(artist) {
return `
- ${artist}
+ ${escapeHtml(artist)}
`;
}
@@ -139,8 +139,8 @@ function renderFileWithMetadataHtml(filepath, lokiId, metadata) {
- ${(!metadata || !metadata.title) ? filepath.split("/").pop() : `${metadata.title}`}
- ${metadata.artist ? `
${metadata.artist}` : ''}
+ ${(!metadata || !metadata.title) ? filepath.split("/").pop() : `${escapeHtml(metadata.title)}`}
+ ${metadata.artist ? `
${escapeHtml(metadata.artist)}` : ''}
@@ -905,7 +905,7 @@ async function getAllArtists() {
}
function getArtistz(el) {
- const artist = el.getAttribute('data-artist');
+ const artist = decodeURIComponent(el.getAttribute('data-artist'));
programState.push({
state: 'artist',
name: artist,
@@ -983,8 +983,8 @@ async function getAllAlbums() {
function getAlbumsOnClick(el) {
getAlbumSongs(
- el.hasAttribute('data-album') ? el.getAttribute('data-album') : null,
- el.hasAttribute('data-artist') ? el.getAttribute('data-artist') : null,
+ el.hasAttribute('data-album') ? decodeURIComponent(el.getAttribute('data-album')) : null,
+ el.hasAttribute('data-artist') ? decodeURIComponent(el.getAttribute('data-artist')) : null,
el.hasAttribute('data-year') ? el.getAttribute('data-year') : null);
}