Identity: a set's number before yEnc is no size; names after an arrow
- The unit-less size before the closing yEnc ('"x.mp3" - 8123 yEnc') took
the set number in 'Newstar Destiny I set 1 [1 of 60] "destiny-001-001.jpg"
yEnc' once the quotes were gone: 97 sets of 60 were one release. A number
of fewer than 4 digits after a word stays.
- unquotedName also cuts after "-> " ("… -> [0001 of 0076] ->
Exclusive-tgirls_000000-lg.jpg"): the arrow was part of the file name.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
18a146e130
commit
e1d21d1e7c
6 files changed
+37
-5
No files matched your search
@@ -63,7 +63,9 @@ export function unquotedName(beforeCounter: string): string | null {
|
||||
// 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)
|
||||
// Or after an arrow ("… -> [0001 of 0076] -> Exclusive-tgirls_000000-lg.jpg").
|
||||
const arrow = text.lastIndexOf('-> ')
|
||||
const cut = Math.max(bracket === -1 ? 0 : bracket + 2, dash === -1 ? 0 : dash + 3, arrow === -1 ? 0 : arrow + 3)
|
||||
const name = text.slice(cut).trim()
|
||||
return name && EXTENSION.test(name) ? name : null
|
||||
}
|
||||
|
||||
@@ -77,8 +77,11 @@ export function subjectRemainder(subject: string): string {
|
||||
// File sizes ("76.88 MB", "335555 Bytes", "336573 byt" cut off, "[347K]") differ per file.
|
||||
.replace(/\b\d+(?:[.,]\d+)?\s*(?:[kmgt]i?b|bytes?|byt)\b/gi, ' ')
|
||||
.replace(/\[\s*\d+(?:[.,]\d+)?\s*[kmgt]\s*\]/gi, ' ')
|
||||
// A size without a unit right before the closing yEnc ("…mp3" - 8123 yEnc").
|
||||
.replace(/\b\d+(\s+yEnc\s*)$/i, '$1')
|
||||
// A size without a unit right before the closing yEnc ("…mp3" - 8123 yEnc"); a short number after a word is a
|
||||
// set's ("… set 1 [1 of 60] "destiny-001-001.jpg" yEnc": 97 sets were one release; LOG.md 2026-10-12 (8)).
|
||||
.replace(/\b(\d+)(\s+yEnc\s*)$/i, (text, n: string, end: string, at: number, s: string) =>
|
||||
n.length >= 4 || !/[A-Za-z0-9]\s*$/.test(s.slice(0, at)) ? end : text
|
||||
)
|
||||
// File sizes follow "yEnc" at the end; other numbers (years, post ids) stay.
|
||||
.replace(/\byEnc\b(\s+\d+)?\s*$/i, ' ')
|
||||
.replace(/\byEnc\b/gi, ' ')
|
||||
|
||||
Reference in new issue
Block a user