diff --git a/js/ui.js b/js/ui.js index fc3dd63..de410d5 100644 --- a/js/ui.js +++ b/js/ui.js @@ -1983,21 +1983,24 @@ export class UIRenderer { container.innerHTML = ''; const GENRES = [ - { id: 'hip_hop', name: 'Hip Hop / Rap' }, - { id: 'pop', name: 'Pop' }, - { id: 'rock', name: 'Rock' }, - { id: 'rnb', name: 'R&B / Soul'}, - { id: 'electronic', name: 'Electronic' }, - { id: 'metal', name: 'Metal'}, - { id: 'country', name: 'Country' }, - { id: 'jazz', name: 'Jazz' }, - { id: 'classical', name: 'Classical' }, - { id: 'latin', name: 'Latin' }, - { id: 'reggae', name: 'Reggae / Dancehall' }, + { id: 'hip_hop', name: 'Hip-Hop' }, + { id: 'rnb', name: 'R&B / Soul' }, { id: 'blues', name: 'Blues' }, - { id: 'soundtrack', name: 'Soundtrack' }, - { id: 'alternative', name: 'Alternative' }, - { id: 'kids', name: 'Kids'} + { id: 'classical', name: 'Classical' }, + { id: 'country', name: 'Country' }, + { id: 'dance_electronic', name: 'Dance & Electronic' }, + { id: 'americana', name: 'Folk / Americana' }, + { id: 'world', name: 'Global' }, + { id: 'gospel', name: 'Gospel / Christian' }, + { id: 'jazz', name: 'Jazz' }, + { id: 'kpop', name: 'K-Pop' }, + { id: 'kids', name: 'Kids' }, + { id: 'latin', name: 'Latin' }, + { id: 'metal', name: 'Metal' }, + { id: 'pop', name: 'Pop' }, + { id: 'reggae', name: 'Reggae / Dancehall' }, + { id: 'retro', name: 'Legacy' }, + { id: 'indierock', name: 'Rock / Indie' }, ]; if (GENRES.length > 0) { @@ -3075,10 +3078,10 @@ export class UIRenderer { dateDisplay = window.innerWidth > 768 ? releaseDate.toLocaleDateString('en-US', { - year: 'numeric', - month: 'long', - day: 'numeric', - }) + year: 'numeric', + month: 'long', + day: 'numeric', + }) : year; } } @@ -4183,9 +4186,9 @@ export class UIRenderer { ${artist.popularity}% popularity
`; @@ -4204,7 +4207,10 @@ export class UIRenderer { const isTrackByArtist = (track) => { if (track.artists && Array.isArray(track.artists)) { return track.artists.some( - (a) => a && ((artist.id && a.id === artist.id) || (a.name && a.name.toLowerCase() === artistNameLower)) + (a) => + a && + ((artist.id && a.id === artist.id) || + (a.name && a.name.toLowerCase() === artistNameLower)) ); } if (track.artist) { @@ -4256,7 +4262,7 @@ export class UIRenderer { const label = playlist.name || playlist.title || 'Playlist'; addSource(track.id, { label, - href: `/userplaylist/${playlist.id}` + href: `/userplaylist/${playlist.id}`, }); } } @@ -4282,8 +4288,11 @@ export class UIRenderer { // Extract artist name and year from existing content const artistLinks = artistDiv.querySelectorAll('.artist-link'); - const artistNames = Array.from(artistLinks).map(a => a.textContent).join(', '); - const truncatedArtist = artistNames.length > 15 ? artistNames.slice(0, 20) + '…' : artistNames; + const artistNames = Array.from(artistLinks) + .map((a) => a.textContent) + .join(', '); + const truncatedArtist = + artistNames.length > 15 ? artistNames.slice(0, 20) + '…' : artistNames; // Extract year from text content (pattern: " • 2024") const fullText = artistDiv.textContent; @@ -4306,7 +4315,10 @@ export class UIRenderer { sourceSpan.appendChild(linkSpan); if (sources.length === 1) { - const srcLabel = sources[0].label.length > 15 ? sources[0].label.slice(0, 15) + '…' : sources[0].label; + const srcLabel = + sources[0].label.length > 15 + ? sources[0].label.slice(0, 15) + '…' + : sources[0].label; linkSpan.textContent = srcLabel; sourceSpan.addEventListener('click', (e) => { e.preventDefault(); @@ -5048,13 +5060,13 @@ export class UIRenderer {