The poster-tag tolerance only without a counter
"[ MacGyver.S01E03.DVDRip.XviD-MEDiEVAL ]-[04/38] - "sample.macgy.s01e03-med.avi""
shares one word with the sample's stem: 6225008 took the name for a tag and
split the episode 17 + 21. A counted subject names its upload.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
62250081ef
commit
0fafe71b21
3 files changed
+16
-10
No files matched your search
@@ -238,7 +238,7 @@ const TAG_WORDS = new Set(['www', 'http', 'https', 'com', 'net', 'org', 'info',
|
||||
* boilerplate doesn't count. A number of 5+ digits is a per-post id
|
||||
* ("FTD 769997", "(781442)"), so never a constant tag.
|
||||
*/
|
||||
export function isPosterTag(remainder: string, stem: string): boolean {
|
||||
export function isPosterTag(remainder: string, stem: string, counted = false): boolean {
|
||||
const words = stem.toLowerCase().replace(/[^a-z0-9]+/g, ' ').trim()
|
||||
const compact = words.replace(/ /g, '')
|
||||
const whole = new Set(words.split(' '))
|
||||
@@ -255,9 +255,10 @@ export function isPosterTag(remainder: string, stem: string): boolean {
|
||||
significant++
|
||||
if (word.length >= 4 ? compact.includes(word) : whole.has(word)) shared++
|
||||
}
|
||||
// A tag of 4+ words may share one with the stem ("German Board - [Usenet4ever.info] und [SecretUsenet.com] -
|
||||
// Without a counter, a tag of 4+ words may share one with the stem ("German Board - [Usenet4ever.info] und [SecretUsenet.com] -
|
||||
// "21.Jump.Street.2012.BDRip.AC3.German.XviD-POE.part01.rar"": the poster's uploads were releases of 1,535 files).
|
||||
return shared === 0 || (shared === 1 && significant >= 4)
|
||||
// With one, that's a name ("[ MacGyver.S01E03.DVDRip.XviD-MEDiEVAL ]-[04/38] - "sample.macgy.s01e03-med.avi"").
|
||||
return shared === 0 || (shared === 1 && significant >= 4 && !counted)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -344,7 +345,7 @@ export function releaseIdentity(input: ReleaseInput): ReleaseIdentity | null {
|
||||
// "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)
|
||||
// A dated stem says which upload it is, short as it is ("09-30-2008_CTC.r00" under "#sterntuary - Coast To Coast Radio Show").
|
||||
const tag = hashed || (!image && !numbered && !AUDIO.test(input.name) && (describes(stem) || dated) && !looksRandom(stem) && isPosterTag(remainder, stem))
|
||||
const tag = hashed || (!image && !numbered && !AUDIO.test(input.name) && (describes(stem) || dated) && !looksRandom(stem) && isPosterTag(remainder, stem, fileTotal !== undefined))
|
||||
// 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() : ''
|
||||
|
||||
Reference in new issue
Block a user