diff --git a/themes/one-pager/assets/js/scripts.js b/themes/one-pager/assets/js/scripts.js index 1209bcb..cb84aa1 100644 --- a/themes/one-pager/assets/js/scripts.js +++ b/themes/one-pager/assets/js/scripts.js @@ -188,22 +188,21 @@ function renderMusicTracks(tracks, containerId, randomize = false) { selected.forEach(track => { let title = '', url = '', image = '', artist = '', album = '', - trackNumber = '', duration = '', released = '', language = '', - tags = [], alt = '', content = ''; + genreTags = [], alt = '', content = ''; if (track.tags) { track.tags.forEach(tag => { - if (tag[0] === 'title') title = tag[1]; - else if (tag[0] === 'url') url = tag[1]; - else if (tag[0] === 'image') image = tag[1]; - else if (tag[0] === 'artist') artist = tag[1]; - else if (tag[0] === 'album') album = tag[1]; - else if (tag[0] === 'track_number') trackNumber = tag[1]; - else if (tag[0] === 'duration') duration = tag[1]; - else if (tag[0] === 'released') released = tag[1]; - else if (tag[0] === 'language') language = tag[1]; - else if (tag[0] === 't') tags.push(tag[1]); - else if (tag[0] === 'alt') alt = tag[1]; + const key = tag[0]; + const value = tag[1]; + + if (key === 'title') title = value; + else if (key === 'url') url = value; + else if (key === 'image') image = value; + else if (key === 'artist') artist = value; + else if (key === 'album') album = value; + // ONLY collect tags with key 't' (genre tags) + else if (key === 't') genreTags.push(value); + else if (key === 'alt') alt = value; }); } content = track.content || ''; @@ -219,23 +218,20 @@ function renderMusicTracks(tracks, containerId, randomize = false) { ${album ? `
${album}
` : ''} ${url ? `` : ''} -