diff --git a/executor.py b/executor.py index 440ded0..cfa559c 100755 --- a/executor.py +++ b/executor.py @@ -52,6 +52,8 @@ def _is_classical(albumartist: str, track_artist: str, genre: str) -> bool: ta = (track_artist or "").casefold().strip() if not aa or aa in ("various artists", "unknown artist", "unknown"): return False + if not ta or ta in ("unknown artist", "unknown"): + return False # placeholder, not a real composer if aa == ta: return False return True # performer ≠ composer → classical naming @@ -76,7 +78,7 @@ def _proposed_filename( disc_prefix = f"{proposal.disc_number}-" if (proposal.disc_number and proposal.disc_number > 1) else "" prefix = f"{disc_prefix}{tn}" - track_artist = _safe_name(proposal.artist or "Unknown") + track_artist = _safe_name(proposal.artist or albumartist or "Unknown") aa = _safe_name(albumartist) title = _safe_name(proposal.title or "Unknown") diff --git a/hint_extractor.py b/hint_extractor.py index cfcb0ff..5804510 100755 --- a/hint_extractor.py +++ b/hint_extractor.py @@ -562,8 +562,10 @@ def extract_hints(scan: AlbumScan, use_ocr: bool = True) -> AlbumHints: disc_num = int(dm.group(1)) break - title = tags.get("title") or fn_hints.get("title") - artist = tags.get("artist") or fn_hints.get("artist") + title_raw = tags.get("title") or fn_hints.get("title") + title = title_raw if _is_good(title_raw) else fn_hints.get("title") + artist_raw = tags.get("artist") or fn_hints.get("artist") + artist = artist_raw if _is_good(artist_raw) else fn_hints.get("artist") # Tracklist-Matching: Nummer → exakter Titel → fuzzy Titel # Wenn ein Match gefunden: disc+track aus Tracklist übernehmen (Tracklist ist diff --git a/music_enricher.py b/music_enricher.py index a8d6355..e14645f 100755 --- a/music_enricher.py +++ b/music_enricher.py @@ -97,7 +97,8 @@ def _print_proposal(proposal: AlbumProposal) -> None: for tp in proposal.tracks[:8]: tn = f"{tp.disc_number}-{tp.track_number:02d}" if tp.disc_number and tp.disc_number > 1 else ( f"{tp.track_number:02d}" if tp.track_number else "??") - print(f" {tn} {tp.artist} – {tp.title}") + display_artist = tp.artist or proposal.albumartist or "Unknown" + print(f" {tn} {display_artist} – {tp.title}") if len(proposal.tracks) > 8: print(f" … und {len(proposal.tracks) - 8} weitere") @@ -156,7 +157,11 @@ def process_album( if args.rename: from executor import _proposed_filename for tp in proposal.tracks: - tp.new_filename = _proposed_filename(tp, tp.path.suffix) + tp.new_filename = _proposed_filename( + tp, tp.path.suffix, + albumartist=proposal.albumartist or "", + genre=proposal.genre or "", + ) # Review step if args.dry_run: