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
50
js/ui.js
50
js/ui.js
|
|
@ -1983,21 +1983,24 @@ export class UIRenderer {
|
||||||
container.innerHTML = '';
|
container.innerHTML = '';
|
||||||
|
|
||||||
const GENRES = [
|
const GENRES = [
|
||||||
{ id: 'hip_hop', name: 'Hip Hop / Rap' },
|
{ id: 'hip_hop', name: 'Hip-Hop' },
|
||||||
{ id: 'pop', name: 'Pop' },
|
{ id: 'rnb', name: 'R&B / Soul' },
|
||||||
{ 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: 'blues', name: 'Blues' },
|
{ id: 'blues', name: 'Blues' },
|
||||||
{ id: 'soundtrack', name: 'Soundtrack' },
|
{ id: 'classical', name: 'Classical' },
|
||||||
{ id: 'alternative', name: 'Alternative' },
|
{ id: 'country', name: 'Country' },
|
||||||
{ id: 'kids', name: 'Kids'}
|
{ 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) {
|
if (GENRES.length > 0) {
|
||||||
|
|
@ -4204,7 +4207,10 @@ export class UIRenderer {
|
||||||
const isTrackByArtist = (track) => {
|
const isTrackByArtist = (track) => {
|
||||||
if (track.artists && Array.isArray(track.artists)) {
|
if (track.artists && Array.isArray(track.artists)) {
|
||||||
return track.artists.some(
|
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) {
|
if (track.artist) {
|
||||||
|
|
@ -4256,7 +4262,7 @@ export class UIRenderer {
|
||||||
const label = playlist.name || playlist.title || 'Playlist';
|
const label = playlist.name || playlist.title || 'Playlist';
|
||||||
addSource(track.id, {
|
addSource(track.id, {
|
||||||
label,
|
label,
|
||||||
href: `/userplaylist/${playlist.id}`
|
href: `/userplaylist/${playlist.id}`,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -4282,8 +4288,11 @@ export class UIRenderer {
|
||||||
|
|
||||||
// Extract artist name and year from existing content
|
// Extract artist name and year from existing content
|
||||||
const artistLinks = artistDiv.querySelectorAll('.artist-link');
|
const artistLinks = artistDiv.querySelectorAll('.artist-link');
|
||||||
const artistNames = Array.from(artistLinks).map(a => a.textContent).join(', ');
|
const artistNames = Array.from(artistLinks)
|
||||||
const truncatedArtist = artistNames.length > 15 ? artistNames.slice(0, 20) + '…' : artistNames;
|
.map((a) => a.textContent)
|
||||||
|
.join(', ');
|
||||||
|
const truncatedArtist =
|
||||||
|
artistNames.length > 15 ? artistNames.slice(0, 20) + '…' : artistNames;
|
||||||
|
|
||||||
// Extract year from text content (pattern: " • 2024")
|
// Extract year from text content (pattern: " • 2024")
|
||||||
const fullText = artistDiv.textContent;
|
const fullText = artistDiv.textContent;
|
||||||
|
|
@ -4306,7 +4315,10 @@ export class UIRenderer {
|
||||||
sourceSpan.appendChild(linkSpan);
|
sourceSpan.appendChild(linkSpan);
|
||||||
|
|
||||||
if (sources.length === 1) {
|
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;
|
linkSpan.textContent = srcLabel;
|
||||||
sourceSpan.addEventListener('click', (e) => {
|
sourceSpan.addEventListener('click', (e) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue