fix: remove Spotify credential requirement — no API keys needed

spotdl (SpotAPI) works without developer credentials. Remove the
health-check warning, credential error UI, and Client Credentials
fallback that were blocking the importer.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
HoneyandClaude Sonnet 4.6 committed 2026-05-11 15:01:35 +02:00
1 parent 9b197e119a
commit eacd68aea7
2 files changed
+3 -64

No files matched your search

+1 -38
View File
@@ -6,32 +6,13 @@ import { makeGlobalTrackItem } from './components.js';
import { openDlModal } from './ui.js';
// ─── SPOTIFY IMPORTER PAGE ───
export async function loadSpotifyImporter() {
export function loadSpotifyImporter() {
if (!document.getElementById('spotify-link-input')?.value) {
const hint = document.getElementById('spotify-importer-hint');
const preview = document.getElementById('spotify-preview');
if (hint) hint.style.display = '';
if (preview) preview.style.display = 'none';
}
if (S.cfg.backendUrl) {
try {
const h = await fetch(`${S.cfg.backendUrl}/api/health`, { signal: AbortSignal.timeout(5000) }).then(r => r.json());
if (!h.spotify?.configured) {
const input = document.getElementById('spotify-link-input');
if (input) {
input.disabled = true;
input.placeholder = 'Spotify-Importer nicht konfiguriert (Server-Setup erforderlich)';
}
const hint = document.getElementById('spotify-importer-hint');
if (hint) hint.innerHTML += `
<div style="margin-top:16px;padding:12px;background:var(--surface);border-radius:10px;border-left:3px solid #1DB954;font-size:13px;color:var(--text2)">
⚠ Server-Admin muss <code>SPOTIFY_CLIENT_ID</code> und <code>SPOTIFY_CLIENT_SECRET</code> setzen.
Kostenlos unter <a href="https://developer.spotify.com/dashboard" target="_blank" style="color:#1DB954">developer.spotify.com/dashboard</a>.
</div>`;
}
} catch { /* health check failed — leave UI as-is */ }
}
}
export function clearSpotifyPreview() {
@@ -108,24 +89,6 @@ export async function resolveSpotifyLink() {
</div>`;
return;
}
if (e.message.includes('SPOTIFY_CLIENT_ID') ||
e.message.includes('Credentials fehlen') ||
e.message.includes('Spotify-Token-Fehler')) {
inner.innerHTML = `<div style="color:var(--text);padding:16px;background:var(--surface);border-radius:10px;border-left:3px solid #1DB954">
<div style="font-weight:600;margin-bottom:8px">Spotify-Importer nicht konfiguriert</div>
<div style="font-size:13px;line-height:1.5">
Der Server-Admin muss einmalig Spotify-Credentials hinterlegen.<br><br>
Schritte:<br>
1. <a href="https://developer.spotify.com/dashboard" target="_blank" style="color:#1DB954">developer.spotify.com/dashboard</a> öffnen<br>
2. "Create app" — Name beliebig, Redirect URI: <code>http://localhost</code><br>
3. Client ID + Secret als Environment-Variablen setzen:<br>
&nbsp;&nbsp;<code>SPOTIFY_CLIENT_ID=...</code><br>
&nbsp;&nbsp;<code>SPOTIFY_CLIENT_SECRET=...</code><br>
4. Backend neu starten
</div>
</div>`;
return;
}
inner.innerHTML = `<div style="color:var(--danger);padding:16px;background:var(--surface);border-radius:10px">${esc(e.message)}</div>`;
}
}