Images and tracks named by a prefix alone are bounded by the counter's total
Test and deploy / test (push) Successful in 1m3s
Test and deploy / edge (push) Successful in 2m10s
Test and deploy / deploy (push) Successful in 3m17s

"[…/559] - "lop1001.jpg"", "pic004.jpg", "DSC_0002[1].jpg", and tracks
"r86_022 - Gwen Guthrie - ….mp3" ("r"): the stem route keyed them by the
letters before the number alone, so every post of a poster was one release
(5,731 images for 559; 6,433 tracks for 457). Under a counter its total is
part of the key; a cover named as its archive's stem keeps the stem's key.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Daan MeijerandClaude Opus 5.5 committed 2026-10-13 23:54:02 +02:00
1 parent 3f6bb8b162
commit 9f255e6ac0
3 files changed
+43 -4

No files matched your search

+10 -2
View File
@@ -437,7 +437,13 @@ export function releaseIdentity(input: ReleaseInput): ReleaseIdentity | null {
const set = imageSet(stem) || prefix || stem
// A word in it, not a size ("01of37 ## Alexi … ## alexis001.jpg 57295b": each image was a release of its own).
const post = isPostToken(remainder) && /[A-Za-z]{2}/.test(remainder)
return { key: post ? hash('stem', poster, set, remainder) : hash('stem', poster, set), name: prefix || stem, fileTotal, source: 'stem' }
// Under a counter, bounded by its total: a set named only by its prefix ("lop1001.jpg", "pic004.jpg", "DSC_0002[1].jpg")
// made every post of the poster one release (5,731 images for 559; LOG.md 2026-10-13 (50)).
const parts: (string | number)[] = ['stem', poster, set]
if (post) parts.push(remainder)
// Not a cover named as its archive's stem ("x.jpg" beside "x.part01.rar"): that keeps the stem's key.
if (fileTotal !== undefined && set !== stem) parts.push(fileTotal)
return { key: hash(...parts), name: prefix || stem, fileTotal, source: 'stem' }
}
// An audiobook's or album's tracks without a name around them: by their name without its numbers, as an
// image set ("… Seeing A Large Cat - D11.16-22.mp3", "Candy Dulfer - Candy Store - 11 - everytime.mp3").
@@ -447,7 +453,9 @@ export function releaseIdentity(input: ReleaseInput): ReleaseIdentity | null {
const scene = postTotal ? SCENE_TRACK.exec(stem) : null
if (scene) return { key: hash('stem', poster, scene[1], postTotal), name: scene[1], fileTotal, source: 'stem' }
const tracks = stem.replace(/\d+\D*$/, '').replace(/\d+/g, ' ').replace(/[\s._-]+/g, ' ').trim()
if (tracks) return { key: hash('stem', poster, tracks), name: tracks, fileTotal, source: 'stem' }
// Bounded by a counter's total too ("r86_022 - Gwen Guthrie - Ain't Nothing….mp3" → "r": a chart's 457 tracks a post,
// every post one release).
if (tracks) return { key: fileTotal !== undefined ? hash('stem', poster, tracks, fileTotal) : hash('stem', poster, tracks), name: tracks, fileTotal, source: 'stem' }
}
// A season's episodes under a bare counter ("[01/36] "Pokemon - S02E01 - Pallet Party Panic.mkv""): one release per
// show, season and counter total (each episode was a release of its own).