Unquoted album tracks: the name starts at the track number
Test and deploy / test (push) Successful in 43s
Test and deploy / edge (push) Successful in 1m50s
Test and deploy / deploy (push) Successful in 1m21s

"A Strange Light from the East - Eastern Influenced Western Music
(1965-72) - CD2 - 07 - Rascals - Sattva.mp3 (1/43)": unquotedName cut at
the last " - " ("Sattva.mp3"), leaving track number and artist in the
subject, so every track was a release (85665085, 85665050). With a
" - NN - " track or part number the name starts there ("07 - Rascals -
Sattva.mp3"), the rest names the album and disc. Both implementations;
tests; fixtures identical.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Daan MeijerandClaude Opus 5.5 committed 2026-10-11 22:41:54 +02:00
1 parent e0a0d0d520
commit 8d400822bd
4 files changed
+29 -2

No files matched your search

+4 -1
View File
@@ -48,7 +48,10 @@ export function unquotedName(beforeCounter: string): string | null {
}
if (EXTENSION.test(text)) {
const bracket = text.lastIndexOf('] ')
const dash = text.lastIndexOf(' - ')
// A track or part number ("Album - CD2 - 07 - Artist - Title.mp3"): the name starts there, so the rest
// is the album, the same for every track (LOG.md 2026-10-11 (10)); else after the last " - ".
const track = / - \d{1,3} - /.exec(text)
const dash = track ? track.index : text.lastIndexOf(' - ')
const cut = Math.max(bracket === -1 ? 0 : bracket + 2, dash === -1 ? 0 : dash + 3)
const name = text.slice(cut).trim()
return name && EXTENSION.test(name) ? name : null