fix: use iTunes US catalog + explicit=Yes to show all tracks including explicit

country=de silently filtered explicit content from iTunes results.
Switched to country=us&explicit=Yes so all songs appear regardless of explicit flag.
Removed wrong explicit-filtering code from views.js.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
HoneyandClaude Sonnet 4.6 committed 2026-04-26 17:48:35 +02:00
1 parent 31e5940ab6
commit fc951d103b
2 files changed
+10 -16

No files matched your search

+9 -15
View File
@@ -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' && !isExplicit(t) && t.artistName?.toLowerCase()===artist.name.toLowerCase())
? (itunesTracksRes.value||[]).filter(t => t.wrapperType==='track' && t.artistName?.toLowerCase()===artist.name.toLowerCase())
: [];
if(itunesTracks.length) {
const tsEl = document.getElementById('artist-topsongs-section');
@@ -325,8 +325,7 @@ 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()) &&
!isExplicit(a)
!serverAlbumNames.has(a.collectionName?.toLowerCase())
);
if(extraAlbums.length) {
const g = document.getElementById('artist-albums-grid');
@@ -541,8 +540,8 @@ export async function doGlobalSearch(q) {
]);
el.innerHTML = '';
const trackResults = tracks.filter(t => t.wrapperType === 'track' && !isExplicit(t));
const albumResults = albums.filter(a => !isExplicit(a));
const trackResults = tracks.filter(t => t.wrapperType === 'track');
const albumResults = albums;
if(artists.length) {
const s = mkSection('Künstler');
@@ -600,8 +599,7 @@ export async function doGlobalSearch(q) {
export async function loadItunesAlbum(album) {
try {
const rawTracks = await itunesLookupAlbum(album.collectionId);
const tracks = rawTracks.filter(t => !isExplicit(t));
const tracks = await itunesLookupAlbum(album.collectionId);
if(!tracks.length) { toast('Keine Tracks gefunden'); return; }
const el = document.getElementById('global-search-results');
const s = document.createElement('div'); s.className = 'search-section';
@@ -629,8 +627,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) && !isExplicit(a));
const artistTracks = topTracks.filter(t => t.wrapperType==='track' && !isExplicit(t) && (t.artistId===artistId || t.artistName===artistName));
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 coverImg = artistAlbums[0]?.artworkUrl100?.replace('100x100','600x600') || '';
el.innerHTML = '';
@@ -797,16 +795,12 @@ async function loadItunesFallbackRecommendations(el, artist, title, html) {
const sec = document.createElement('div');
sec.innerHTML = `<div class="section-title" style="margin-bottom:10px">Mehr von ${esc(artist)}</div>`;
const list = document.createElement('div'); list.className = 'song-list';
results.filter(t => t.artistName===artist && !isExplicit(t)).slice(0,15).forEach(t => list.appendChild(makeGlobalTrackItem(t, 0, [t])));
if(!list.children.length) results.filter(t => !isExplicit(t)).slice(0,15).forEach(t => list.appendChild(makeGlobalTrackItem(t, 0, [t])));
results.filter(t => t.artistName===artist).slice(0,15).forEach(t => list.appendChild(makeGlobalTrackItem(t, 0, [t])));
if(!list.children.length) results.slice(0,15).forEach(t => list.appendChild(makeGlobalTrackItem(t, 0, [t])));
sec.appendChild(list); el.appendChild(sec);
}
// ─── HELPERS ───
function isExplicit(item) {
return item.trackExplicitness === 'explicit' || item.collectionExplicitness === 'explicit';
}
export function expandArtistBio() {
const el = document.getElementById('artist-bio-text');
if(el && window._artistBioFull) el.textContent = window._artistBioFull;