feat(web+android): vom Album in der globalen Suche zum Künstler springen (2.5 / Android 1.8)
Der Künstlername unter einem Deezer-Album war reiner Text — von dort zum
Künstler ging nur über Zurück und neu suchen. Er ist jetzt anklickbar und
öffnet dieselbe Deezer-Künstlerseite wie eine Künstler-Kachel.
Kostet keinen zusätzlichen API-Aufruf: Deezer legt /search/album und
/album/{id} das artist-Objekt samt id bei (120/120 Treffer über zwölf
Suchen geprüft), beide Mappings übernahmen die id längst.
/artist/{id}/albums lässt das artist-Objekt weg — Alben von dort bleiben
bewusst reiner Text, statt ins Leere zu zeigen.
Android zeigte in der Album-Detailansicht bisher gar keinen Künstler und
lädt Bild + Fanzahl nach, wenn der Künstler aus einem Album stammt.
.album-artist-name trug cursor:pointer auch ohne Ziel — jetzt nur noch,
wo wirklich etwas dahintersteht.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
fca7cc79c1
commit
ec75fdef7b
7 files changed
+90
-10
No files matched your search
+11
-1
@@ -482,7 +482,17 @@ export async function loadArtistAllSongs({ albums, artist }) {
|
||||
export async function loadDeezerAlbumDetail(album) {
|
||||
document.getElementById('deezer-album-back-btn').onclick = () => _navGoBack();
|
||||
document.getElementById('deezer-album-detail-name').textContent = album.collectionName || '—';
|
||||
document.getElementById('deezer-album-detail-artist').textContent = album.artistName || '';
|
||||
// Deezer liefert die Künstler-ID in jedem Albumtreffer gleich mit — ohne sie ist der Name nur
|
||||
// toter Text (z. B. bei Alben aus /artist/{id}/albums, wo Deezer das artist-Objekt weglässt).
|
||||
const dzArtistEl = document.getElementById('deezer-album-detail-artist');
|
||||
dzArtistEl.textContent = album.artistName || '';
|
||||
dzArtistEl.onclick = null;
|
||||
dzArtistEl.classList.toggle('is-link', !!(album.artistId && album.artistName));
|
||||
if (album.artistId && album.artistName) {
|
||||
dzArtistEl.onclick = () => navigate('artist-detail', {
|
||||
id: null, name: album.artistName, deezerArtistId: album.artistId, deezerFanCount: null,
|
||||
});
|
||||
}
|
||||
const cw = document.getElementById('deezer-album-cover-wrap');
|
||||
const art = (album.artworkUrl100 || '').replace('100x100bb','600x600bb').replace('100x100','600x600');
|
||||
cw.innerHTML = art ? `<img src="${art}" onerror="_imgRetry(this,'💿')">` : '<div class="no-art">💿</div>';
|
||||
|
||||
+7
-1
@@ -206,7 +206,7 @@ export async function loadDeezerAlbum(album) {
|
||||
<button class="back-btn" style="margin:0" onclick="document.getElementById('global-search-input').dispatchEvent(new Event('input'))"><svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polyline points="15 18 9 12 15 6"/></svg>Zurück</button>
|
||||
<div style="flex:1">
|
||||
<div style="font-size:15px;font-weight:700">${esc(album.collectionName)}</div>
|
||||
<div style="font-size:12px;color:var(--text2)">${esc(album.artistName)}</div>
|
||||
<div style="font-size:12px;color:var(--text2)"${album.artistId ? ' class="song-link" id="dz-alb-artist"' : ''}>${esc(album.artistName)}</div>
|
||||
</div>
|
||||
<button class="btn-outline blue" style="font-size:12px;padding:7px 12px" onclick="openDlModal({artistName:'${esc(album.artistName)}',trackName:'${esc(album.collectionName)}',artworkUrl100:'${album.artworkUrl100||''}',collectionName:'${esc(album.collectionName)}',isAlbum:true,deezerData:${JSON.stringify(album).replace(/"/g,'"')}})">⬇ Album laden</button>
|
||||
</div>
|
||||
@@ -215,6 +215,12 @@ export async function loadDeezerAlbum(album) {
|
||||
tracks.forEach((t,i) => list.appendChild(makeGlobalTrackItem(t, i, tracks)));
|
||||
s.appendChild(list);
|
||||
el.innerHTML = ''; el.appendChild(s);
|
||||
// Deezer hängt an jeden Albumtreffer das Artist-Objekt mit id — ein Sprung zum Künstler
|
||||
// kostet also keinen zusätzlichen Aufruf.
|
||||
if (album.artistId) {
|
||||
s.querySelector('#dz-alb-artist')?.addEventListener('click', () =>
|
||||
loadDeezerArtistResults(album.artistId, album.artistName, null));
|
||||
}
|
||||
} catch(e) { toast('Fehler: ' + e.message); }
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user