feat: artist concerts via Bandsintown — button + modal with ticket links
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
1 parent
6bbebcc602
commit
914297651e
6 files changed
+86
-3
No files matched your search
+11
-1
@@ -7,6 +7,7 @@ import { showCtxMenu, openDlModal } from '../ui/ui.js';
|
||||
// Circular — safe (called inside event handlers / function bodies)
|
||||
import { navigate, _navGoBack } from './navigation.js';
|
||||
import { getArtistImage } from './home.js';
|
||||
import { fetchEvents, openEventsModal } from './events.js';
|
||||
|
||||
// ─── QUICK PLAY HELPERS ───
|
||||
export async function quickPlayAlbum(a) {
|
||||
@@ -85,7 +86,7 @@ export async function loadArtistDetail(artist) {
|
||||
const hasND = !!artist.id;
|
||||
const knownItunes = artist.itunesArtistId || null;
|
||||
|
||||
const [imgRes, albumRes, infoRes, topRes, iArtistRes] = await Promise.allSettled([
|
||||
const [imgRes, albumRes, infoRes, topRes, iArtistRes, eventsRes] = await Promise.allSettled([
|
||||
hasND ? getArtistImage(artist.id) : Promise.resolve(null),
|
||||
hasND ? api('getArtist', `&id=${artist.id}`) : Promise.resolve(null),
|
||||
hasND ? api('getArtistInfo2',`&id=${artist.id}&count=8`) : Promise.resolve(null),
|
||||
@@ -93,6 +94,7 @@ export async function loadArtistDetail(artist) {
|
||||
knownItunes
|
||||
? Promise.resolve([{ artistId: knownItunes }])
|
||||
: itunesSearch(artist.name, 'musicArtist', 5),
|
||||
fetchEvents(artist.name),
|
||||
]);
|
||||
|
||||
const _normWords = s => new Set((s || '').toLowerCase().replace(/[^a-z0-9]/g, ' ').split(/\s+/).filter(Boolean));
|
||||
@@ -226,6 +228,14 @@ export async function loadArtistDetail(artist) {
|
||||
actionBar.appendChild(playTopBtn);
|
||||
actionBar.appendChild(shuffleBtn);
|
||||
}
|
||||
const events = eventsRes.status === 'fulfilled' ? (eventsRes.value || []) : [];
|
||||
if(events.length) {
|
||||
const evBtn = document.createElement('button');
|
||||
evBtn.className = 'artist-action-btn';
|
||||
evBtn.innerHTML = `<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><rect x="3" y="4" width="18" height="18" rx="2"/><line x1="16" y1="2" x2="16" y2="6"/><line x1="8" y1="2" x2="8" y2="6"/><line x1="3" y1="10" x2="21" y2="10"/></svg> Konzerte <span style="font-size:11px;opacity:.7">(${events.length})</span>`;
|
||||
evBtn.onclick = () => openEventsModal(events, artist.name);
|
||||
actionBar.appendChild(evBtn);
|
||||
}
|
||||
}
|
||||
|
||||
if(albEl) { albEl.innerHTML = ''; _renderArtistAlbums(albEl, ndAlbums, iAlbums, artist); }
|
||||
|
||||
Reference in new issue
Block a user