Fix CDDB album name extraction from header line

The header line can have a prefix before the dashes, e.g.:
  "#1 (Musicbrainz): ---- Artist / Album ----"
Use regex search for content between ---- markers instead of
stripping leading/trailing dashes from the full line.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Dieter Schlüter 2026-02-18 10:32:35 +01:00
commit 0c0311b00f

View file

@ -207,10 +207,11 @@ def _stream_abcde(
stripped_hdr = line.strip()
print(f"\n {stripped_hdr}", flush=True)
# Album-Name zwischen den Strichen extrahieren (einmalig)
# Zeile z.B.: "#1 (Musicbrainz): ---- Artist / Album ----"
if not detected_album:
inner = re.sub(r"^[-\s]+|[-\s]+$", "", stripped_hdr)
if inner:
detected_album = inner
inner_m = re.search(r"-{2,}\s*(.+?)\s*-{2,}", stripped_hdr)
if inner_m:
detected_album = inner_m.group(1).strip()
continue
# ── CDDB track lines "1: Artist - Title" or "1: Artist / Title"