more generas in the hot and new section
This commit is contained in:
parent
e5b4cf6adf
commit
6b1619d2c3
1 changed files with 40 additions and 28 deletions
48
js/ui.js
48
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: 'hip_hop', name: 'Hip-Hop' },
|
||||
{ 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: '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) {
|
||||
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Reference in a new issue