Identity: other quoted text, text separators, ids in image names, more
Test and deploy / test (push) Successful in 49s
Test and deploy / edge (push) Successful in 2m0s
Test and deploy / deploy (push) Successful in 2m1s

- Quoted text other than the file name stays in the remainder: ">>> CREATIVE
  COMMONS NZB <<< "0190 alarm 5.0 " - File 1 of 9: "…rar"" made 12,605
  files of all uploads one release.
- namesRelease accepts words joined by , & : ; \ / + ("Posting & deleting,
  read 0 file "E:\VladModels\y038_Irina\185" …"): such image sets fell to
  the stem rule ("P8250001.JPG"), one release over all folders.
- imageSet: a 5+ digit number left in the set is a per-image id
  ("sss-70556-3474182-23-10825418-pc", "Alena p 26663_…"): no set. Copy
  markers may repeat ("diana-050-052[1][1]").
- unquotedName: an image after numbered text without a separator is the
  last word ("<abm> … AB: part2 0573-1002 043.jpg").

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Daan MeijerandClaude Opus 5.5 committed 2026-10-12 07:51:21 +02:00
1 parent e1d21d1e7c
commit 3fc38edda8
6 files changed
+84 -18

No files matched your search

+16 -7
View File
@@ -119,8 +119,8 @@ export function namesRelease(remainder: string): boolean {
.split(/\s+/)
.filter((w) => w && !isRandomToken(w))
.join(' ')
// At least two words of letters, joined the way release names are.
return /[A-Za-z]{2,}[._ -]+[A-Za-z0-9]{2,}/.test(words)
// At least two words of letters, joined the way release names are (or as text is: "Posting & deleting, read 0 file").
return /[A-Za-z]{2,}[._ \-,&:;\\/+]+[A-Za-z0-9]{2,}/.test(words)
}
function hash(...parts: (string | number | undefined)[]) {
@@ -158,7 +158,7 @@ export function imageSet(stem: string): string {
// Suffixes that number no image: a copy's ("sexypattycake_0903040445[1]"), a resolution ("092_081_2000x1500",
// "01079-106-2048px"), ImageVenue's ("…_17_123_244lo"), a constant one ("KP0027_197_00").
const plain = stem
.replace(/\s*[[(]\d+[\])]$/, '')
.replace(/(?:\s*[[(]\d+[\])])+$/, '')
.replace(/[_-]\d{3,4}(?:x\d{3,4}|px)$/i, '')
.replace(/_123_\d+lo$/i, '')
.replace(/[_-]0+$/, '')
@@ -183,7 +183,10 @@ export function imageSet(stem: string): string {
if (repeat || renumbered || /^(?:19|20)\d\d$/.test(n) || n.length >= 4) s = before
else break
}
return /\d/.test(s) ? s.replace(/\d+\D*$/, '') : ''
const set = /\d/.test(s) ? s.replace(/\d+\D*$/, '') : ''
// A number of 5+ digits (without leading zeros) left in it is an id, per image ("sss-70556-3474182-23-10825418-pc",
// "Alena p 26663_…"): no set. A padded set number ("01079-106") is one.
return /(?<!\d)0*[1-9]\d{4,}/.test(set) ? '' : set
}
export function counterTotal(subject: string): number | undefined {
@@ -271,9 +274,15 @@ export function releaseIdentity(input: ReleaseInput): ReleaseIdentity | null {
// as the quotes would have been: otherwise every file of a set would name a release of its own.
// The subject here has its spaces collapsed; the name may not ("lara_bath 15of19 larabath_2.5.jpg").
const collapsed = input.name.replace(/\s+/g, ' ').trim()
const named = input.subject.includes(`"${input.name}"`)
? input.subject
: (input.subject.includes(input.name) ? input.subject.replace(input.name, ' ') : input.subject.replace(collapsed, ' ')).replace(/"/g, ' ')
// Other quoted text stays: it names the release (">>> CREATIVE COMMONS NZB <<< "0190 alarm 5.0 " - File 1 of 9:
// "creative_commons_nzb_0190_alarm_5.0_.rar"": 12,605 files of 1,400 uploads were one release; LOG.md 2026-10-12 (9)).
const named = (
input.subject.includes(`"${input.name}"`)
? input.subject.replace(`"${input.name}"`, ' ')
: input.subject.includes(input.name)
? input.subject.replace(input.name, ' ')
: input.subject.replace(collapsed, ' ')
).replace(/"/g, ' ')
const remainder = subjectRemainder(named)
// Counted without the file name, as quoted names are: "shyla-shy-09-0195.jpg hardcore …" is no "9 of 195"
// (each of 866 images was a release of its own; LOG.md 2026-10-12 (5)).