Identity: hashed stems under a tag, numbered volumes, scene tracks
From the top-100 groups:
- A hashed stem under text without a counter is the upload ("Seit 1753
Tagen - usenet4ever.info - "055631a1_b6c820bc_…-u4e.part01.rar""): the
day's uploads were one release of 3,747 files.
- A numbered volume as the extension, within the [i/M] total ("(????)
[0659/2195] - "DN.VPL PCK.1508"", "TKY.ASN PCK.691."): keyed without it.
- Scene tracks under a bare counter ("[06/14] - "02-repiet_-_dont_think_
twice_(extended_mix).mp3""): the artist's album bounded by the total.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
3fc38edda8
commit
d43603a43f
3 files changed
+69
-4
No files matched your search
+17
-2
@@ -127,6 +127,10 @@ function hash(...parts: (string | number | undefined)[]) {
|
||||
return digest('sha1', parts.map((p) => p ?? '').join('\n'))
|
||||
}
|
||||
|
||||
const HASHED = /^[0-9a-f]{8,}(?:_[0-9a-f]{6,}){2,}(?:-[0-9a-z]+)?$/i
|
||||
const SCENE_TRACK = /^\d{1,3}[-_ .]+(.+?)(?:_-_| - |-)/
|
||||
const VOLUME_NUMBER = /^(.*[^\d. ])[. ](\d{1,5})\.?$/
|
||||
|
||||
/** Image files: a set's images are named one by one ("IMG_3086.jpg"); its subject names the set. */
|
||||
const IMAGE = /\.(jpe?g|png|gif|bmp|webp|tiff?)$/i
|
||||
|
||||
@@ -300,7 +304,10 @@ export function releaseIdentity(input: ReleaseInput): ReleaseIdentity | null {
|
||||
// lessons were releases of their own; LOG.md 2026-10-11 (7)). Uploads hours apart are apart anyway.
|
||||
// Also after a disc code ("SC8367-12 - Wynette, Tammy - Singing My Song", karaoke discs).
|
||||
const numbered = /^(?:[A-Z]{1,5}\d{2,6}[-_ ])?\d{1,3}[ ._-]/.test(stem)
|
||||
const tag = !image && !numbered && !AUDIO.test(input.name) && describes(stem) && !looksRandom(stem) && isPosterTag(remainder, stem)
|
||||
// A hashed stem under text without a counter is the upload, the text a tag ("Seit 1753 Tagen - usenet4ever.info -
|
||||
// "055631a1_b6c820bc_a856086c_85112a5-u4e.part01.rar"": a day's uploads were one release; LOG.md 2026-10-12 (11)).
|
||||
const hashed = fileTotal === undefined && HASHED.test(stem)
|
||||
const tag = hashed || (!image && !numbered && !AUDIO.test(input.name) && describes(stem) && !looksRandom(stem) && isPosterTag(remainder, stem))
|
||||
// An image set without a counter: the image's name up to its last number, without numbers
|
||||
// ("Kitchen Hottie 1 set233-76-lg" → "Kitchen Hottie set", "bm_jessica_blb_h087" → "bm jessica blb h").
|
||||
const prefix = image ? stem.replace(/\d+\D*$/, '').replace(/\d+/g, ' ').replace(/[\s._-]+/g, ' ').trim() : ''
|
||||
@@ -332,12 +339,20 @@ export function releaseIdentity(input: ReleaseInput): ReleaseIdentity | null {
|
||||
// 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").
|
||||
if (AUDIO.test(input.name)) {
|
||||
// Scene tracks under a bare counter ("[06/14] - "02-repiet_-_dont_think_twice_(extended_mix).mp3""): the
|
||||
// artist's album, bounded by the counter's total (each track was a release of its own).
|
||||
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' }
|
||||
}
|
||||
// The [i/M] total is informational, not part of the key: posters often
|
||||
// upload the par2 index without a counter, and it belongs to the same post.
|
||||
return { key: hash('stem', poster, stem), name: stem, fileTotal, source: 'stem' }
|
||||
// A numbered volume as the extension, within the counter's total ("(????) [0659/2195] - "DN.VPL PCK.1508"",
|
||||
// "TKY.ASN PCK.691."): the volumes are one upload.
|
||||
const volume = VOLUME_NUMBER.exec(stem)
|
||||
const base = volume && postTotal && Number(volume[2]) <= postTotal ? volume[1] : stem
|
||||
return { key: hash('stem', poster, base), name: stem, fileTotal, source: 'stem' }
|
||||
}
|
||||
|
||||
/** Release of a par2 recovery set; every file listed in it belongs to it. */
|
||||
|
||||
Reference in new issue
Block a user