diff --git a/src/views.js b/src/views.js
index f0785a2..eb5034d 100644
--- a/src/views.js
+++ b/src/views.js
@@ -305,7 +305,7 @@ export async function loadArtistDetail(artist) {
// ── iTunes: global top tracks ──
const itunesTracks = itunesTracksRes.status==='fulfilled'
- ? (itunesTracksRes.value||[]).filter(t => t.wrapperType==='track' && t.artistName?.toLowerCase()===artist.name.toLowerCase())
+ ? (itunesTracksRes.value||[]).filter(t => t.wrapperType==='track' && !isExplicit(t) && t.artistName?.toLowerCase()===artist.name.toLowerCase())
: [];
if(itunesTracks.length) {
const tsEl = document.getElementById('artist-topsongs-section');
@@ -325,7 +325,8 @@ export async function loadArtistDetail(artist) {
const serverAlbumNames = new Set((albumRes.status==='fulfilled' ? (albumRes.value.artist?.album||[]) : []).map(a => a.name.toLowerCase()));
const extraAlbums = itunesAlbums.filter(a =>
(a.artistId === undefined || a.artistName?.toLowerCase() === artist.name.toLowerCase()) &&
- !serverAlbumNames.has(a.collectionName?.toLowerCase())
+ !serverAlbumNames.has(a.collectionName?.toLowerCase()) &&
+ !isExplicit(a)
);
if(extraAlbums.length) {
const g = document.getElementById('artist-albums-grid');
@@ -533,48 +534,16 @@ export function onGlobalSearch(val) {
export async function doGlobalSearch(q) {
const el = document.getElementById('global-search-results');
try {
- const [serverRes, tracks, albums, artists] = await Promise.all([
- api('search3', `&query=${encodeURIComponent(q)}&songCount=15&albumCount=5&artistCount=3`).catch(() => null),
- itunesSearch(q,'musicTrack',20),
+ const [tracks, albums, artists] = await Promise.all([
+ itunesSearch(q,'musicTrack',25),
itunesSearch(q,'album',10),
itunesSearch(q,'musicArtist',6)
]);
el.innerHTML = '';
- // ── Library results (Navidrome) ──
- const srvRes = serverRes?.searchResult3 || {};
- const srvSongs = srvRes.song || [], srvArtists = srvRes.artist || [], srvAlbums = srvRes.album || [];
- if(srvSongs.length || srvArtists.length || srvAlbums.length) {
- const s = mkSection('📚 In meiner Bibliothek');
- if(srvArtists.length) {
- const row = document.createElement('div'); row.className = 'scroll-row';
- srvArtists.forEach(a => {
- const c = makeCard(a.name, a.albumCount+' Alben', null, '🎤');
- c.onclick = () => navigate('artist-detail', a);
- row.appendChild(c);
- getArtistImage(a.id).then(img => {
- if(!img) return;
- const artEl = c.querySelector('.card-art'); if(!artEl) return;
- artEl.innerHTML = `
Keine Ergebnisse gefunden
Suche fehlgeschlagen: ${e.message}
`; } @@ -631,7 +600,8 @@ export async function doGlobalSearch(q) { export async function loadItunesAlbum(album) { try { - const tracks = await itunesLookupAlbum(album.collectionId); + const rawTracks = await itunesLookupAlbum(album.collectionId); + const tracks = rawTracks.filter(t => !isExplicit(t)); if(!tracks.length) { toast('Keine Tracks gefunden'); return; } const el = document.getElementById('global-search-results'); const s = document.createElement('div'); s.className = 'search-section'; @@ -659,8 +629,8 @@ export async function loadItunesArtistResults(artistId, artistName) { itunesSearch(artistName, 'album', 20), itunesSearch(artistName, 'musicTrack', 10), ]); - const artistAlbums = albums.filter(a => a.artistId===artistId || a.artistName===artistName); - const artistTracks = topTracks.filter(t => t.wrapperType==='track' && (t.artistId===artistId || t.artistName===artistName)); + const artistAlbums = albums.filter(a => (a.artistId===artistId || a.artistName===artistName) && !isExplicit(a)); + const artistTracks = topTracks.filter(t => t.wrapperType==='track' && !isExplicit(t) && (t.artistId===artistId || t.artistName===artistName)); const coverImg = artistAlbums[0]?.artworkUrl100?.replace('100x100','600x600') || ''; el.innerHTML = ''; @@ -827,12 +797,16 @@ async function loadItunesFallbackRecommendations(el, artist, title, html) { const sec = document.createElement('div'); sec.innerHTML = `