Fix disc numbering consistency and false tracklist matches
executor: disc=1 now generates '1-01' prefix (same as disc=2 → '2-01'), so multi-disc albums have consistent D-TT scheme throughout. Single-disc tracks without disc tag stay as plain 'TT'. hint_extractor: tracklist pattern 2 now requires '.' ')' or ':' as separator (not bare whitespace) — prevents false-positive matches like '2 x CD, Compilation, Remastered' being parsed as track 2. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
d1391fc36a
commit
28f716f8f2
2 changed files with 7 additions and 3 deletions
|
|
@ -72,7 +72,9 @@ def _proposed_filename(
|
|||
Fehlende Teile werden weggelassen.
|
||||
"""
|
||||
tn = f"{proposal.track_number:02d}" if proposal.track_number else "00"
|
||||
disc_prefix = f"{proposal.disc_number}-" if proposal.disc_number and proposal.disc_number > 1 else ""
|
||||
# Wenn disc_number gesetzt (auch disc=1): immer "D-TT" — konsistent über alle CDs.
|
||||
# disc=None (Einzel-CD ohne Tag): nur "TT".
|
||||
disc_prefix = f"{proposal.disc_number}-" if proposal.disc_number else ""
|
||||
prefix = f"{disc_prefix}{tn}"
|
||||
|
||||
track_artist = _safe_name(proposal.artist or "Unknown")
|
||||
|
|
|
|||
|
|
@ -41,8 +41,10 @@ _DIR_PATTERNS = [
|
|||
# Tracklist line patterns
|
||||
_TRACKLIST_PATTERNS = [
|
||||
re.compile(r"^(?P<disc>\d{1,2})[- _](?P<track>\d{1,3})\s+(?P<title>.+?)(?:\s+\d+:\d{2})?$"),
|
||||
re.compile(r"^(?P<track>\d{1,3})[.):\s]+(?P<title>.+?)(?:\s+\d+:\d{2})?$"),
|
||||
re.compile(r"^(?P<track>[A-Z]\d{1,2})[.):\s]+(?P<title>.+?)(?:\s+\d+:\d{2})?$"),
|
||||
# Separator muss . ) oder : sein — reines Leerzeichen reicht nicht
|
||||
# (verhindert False-Positives wie "2 x CD, Compilation, Remastered")
|
||||
re.compile(r"^(?P<track>\d{1,3})[.):]\s*(?P<title>.+?)(?:\s+\d+:\d{2})?$"),
|
||||
re.compile(r"^(?P<track>[A-Z]\d{1,2})[.):]\s*(?P<title>.+?)(?:\s+\d+:\d{2})?$"),
|
||||
]
|
||||
|
||||
_DISC_SECTION_RE = re.compile(r"(?i)(?:cd|disc|disk|side)[_ \-]*(\d{1,2})")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue