Include albumartist in filename; remove Claude API from LLM chain

Filename schema now: TT - AlbumArtist - TrackArtist - Title when albumartist
differs from track artist (e.g. pianist vs. composer). Identical artist → old
two-part format unchanged.

metadata_resolver: removed Claude API fallback entirely from _claude_resolve.
Chain is now Ollama (local, free) → OpenRouter (DeepSeek V3, cheap) only.

music_enricher: updated status line and use_claude flag accordingly.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Dieter Schlüter 2026-04-28 22:22:10 +02:00
commit 8bd48cf166
3 changed files with 13 additions and 24 deletions

View file

@ -272,8 +272,8 @@ def _resolve_via_openrouter(hints: AlbumHints, partial: Dict) -> Optional[Dict]:
def _claude_resolve(hints: AlbumHints, partial: Dict) -> Optional[Dict]:
"""
Reihenfolge: Ollama (lokal, kostenlos) OpenRouter (günstig) Claude API.
Ollama wird versucht wenn OLLAMA_HOST erreichbar; kein Key nötig.
Reihenfolge: Ollama (lokal, kostenlos) OpenRouter (günstig).
Claude API wird bewusst nicht genutzt (zu teuer).
"""
# 1. Ollama lokal (bevorzugt — kostenlos, RTX 3090)
result = _resolve_via_ollama(hints, partial)
@ -286,21 +286,6 @@ def _claude_resolve(hints: AlbumHints, partial: Dict) -> Optional[Dict]:
if result:
return result
# 3. Claude API als letzter Fallback
if not HAS_ANTHROPIC or not ANTHROPIC_API_KEY:
return None
try:
client = anthropic.Anthropic(api_key=ANTHROPIC_API_KEY)
prompt = _build_resolve_prompt(hints, partial)
message = client.messages.create(
model="claude-haiku-4-5-20251001",
max_tokens=300,
messages=[{"role": "user", "content": prompt}],
)
text = message.content[0].text.strip()
return _parse_json_response(text)
except Exception as e:
print(f" ⚠️ Claude-API-Fehler: {e}", file=sys.stderr)
return None