diff --git a/edge/src/names.rs b/edge/src/names.rs index c42c417..409f388 100644 --- a/edge/src/names.rs +++ b/edge/src/names.rs @@ -640,9 +640,9 @@ pub fn is_poster_tag(remainder: &str, stem: &str, counted: bool) -> bool { let words: Vec<&str> = lower.split(|c: char| !(c.is_ascii_lowercase() || c.is_ascii_digit())).filter(|w| !w.is_empty()).collect(); let compact: String = words.concat(); let whole: std::collections::HashSet<&str> = words.iter().copied().collect(); - // A per-post id, also inside a word ("FTD772544"). + // A per-post id, also inside a word ("FTD772544"), under a counter; without one the board's or the dump's. let b = remainder.as_bytes(); - if b.windows(5).any(|w| w.iter().all(u8::is_ascii_digit)) { + if counted && b.windows(5).any(|w| w.iter().all(u8::is_ascii_digit)) { return false; } let rem = remainder.to_lowercase(); @@ -1262,6 +1262,8 @@ mod tests { assert_eq!(a.source, "stem"); let ftd1 = release_identity("p", r#"FTD769997 [01/23] - "Prison.Break.S04E02.720p.part01.rar" yEnc"#, "Prison.Break.S04E02.720p.part01.rar"); let ftd2 = release_identity("p", r#"FTD769997 [23/23] - "Prison.Break.S04E02.720p.part.par2" yEnc"#, "Prison.Break.S04E02.720p.part.par2"); + let kere = |n: &str| release_identity("p", &format!(" - ID - 1855891249 - {n}"), n); + assert_ne!(kere("Along.The.Ridge.2006.Limited.PAL.DVDr-TWCiSO.rar").key, kere("Altera.QUARTUS.II.DSP.Builder.v7.2.SP1-SHooTERS.rar").key); assert_eq!(ftd1.key, ftd2.key); let scene = release_identity("p", r#"Some.Movie.2008.DVDRip.XviD-GRP [01/40] - "grp-sm.part01.rar" yEnc"#, "grp-sm.part01.rar"); assert_eq!(scene.name, "Some Movie 2008 DVDRip XviD GRP"); diff --git a/lib/release/identity.ts b/lib/release/identity.ts index 2f1cd21..8c289de 100644 --- a/lib/release/identity.ts +++ b/lib/release/identity.ts @@ -250,8 +250,10 @@ export function isPosterTag(remainder: string, stem: string, counted = false): b const words = stem.toLowerCase().replace(/[^a-z0-9]+/g, ' ').trim() const compact = words.replace(/ /g, '') const whole = new Set(words.split(' ')) - // A per-post id, also inside a word ("FTD772544"). - if (/\d{5,}/.test(remainder)) return false + // A per-post id, also inside a word ("FTD772544"), under a counter. Without one it's the board's or the dump's + // (" - ID - 1855891249 - Along.The.Ridge.2006.Limited.PAL.DVDr-TWCiSO.rar": thousands of + // releases were one of 9,444 files; LOG.md 2026-10-13 (36)). + if (counted && /\d{5,}/.test(remainder)) return false let significant = 0 let shared = 0 for (const word of remainder.toLowerCase().split(/[^a-z0-9]+/)) { diff --git a/tests/unit/release/identity.spec.ts b/tests/unit/release/identity.spec.ts index 7100e17..552c083 100644 --- a/tests/unit/release/identity.spec.ts +++ b/tests/unit/release/identity.spec.ts @@ -459,6 +459,9 @@ test.group('release / par2 names', () => { // A number in common ("35"), and a per-post id ("FTD769997"). assert.equal(id('[Audiofiles_DIE_ZEIT_35] [01/24] - "35_China_dl.mp3" yEnc', '35_China_dl.mp3').key, id('[Audiofiles_DIE_ZEIT_35] [02/24] - "35_Bamberg_dl.mp3" yEnc', '35_Bamberg_dl.mp3').key) assert.equal(id('FTD769997 [01/23] - "Prison.Break.S04E02.720p.part01.rar" yEnc', 'Prison.Break.S04E02.720p.part01.rar').key, id('FTD769997 [23/23] - "Prison.Break.S04E02.720p.part.par2" yEnc', 'Prison.Break.S04E02.720p.part.par2').key) + // Without a counter a long number is the board's, not a post's: a dump of separate releases. + const kere = (n: string) => id(` - ID - 1855891249 - ${n}`, n) + assert.notEqual(kere('Along.The.Ridge.2006.Limited.PAL.DVDr-TWCiSO.rar').key, kere('Altera.QUARTUS.II.DSP.Builder.v7.2.SP1-SHooTERS.rar').key) // A scene name with abbreviated file names, and a generically named sidecar. const scene = id('Some.Movie.2008.DVDRip.XviD-GRP [01/40] - "grp-sm.part01.rar" yEnc', 'grp-sm.part01.rar') assert.equal(scene.name, 'Some Movie 2008 DVDRip XviD GRP')