A poster 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"": "German" in the stem made the tag a name, and the poster's readable uploads were releases of 1,422 and 1,535 files. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
cfd29c8de3
commit
62250081ef
3 files changed
+16
-4
No files matched your search
+7
-2
@@ -605,6 +605,7 @@ pub fn is_poster_tag(remainder: &str, stem: &str) -> bool {
|
||||
return false;
|
||||
}
|
||||
let rem = remainder.to_lowercase();
|
||||
let (mut significant, mut shared) = (0, 0);
|
||||
for word in rem.split(|c: char| !(c.is_ascii_lowercase() || c.is_ascii_digit())) {
|
||||
if !word.is_empty() && word.bytes().all(|c| c.is_ascii_digit()) {
|
||||
if word.len() >= 2 && whole.contains(word) {
|
||||
@@ -615,11 +616,13 @@ pub fn is_poster_tag(remainder: &str, stem: &str) -> bool {
|
||||
if word.len() < 3 || TAG_WORDS.contains(&word) {
|
||||
continue;
|
||||
}
|
||||
significant += 1;
|
||||
if if word.len() >= 4 { compact.contains(word) } else { whole.contains(word) } {
|
||||
return false;
|
||||
shared += 1;
|
||||
}
|
||||
}
|
||||
true
|
||||
// A tag of 4+ words may share one with the stem ("German Board - [Usenet4ever.info] und [SecretUsenet.com]").
|
||||
shared == 0 || (shared == 1 && significant >= 4)
|
||||
}
|
||||
|
||||
/// releaseIdentity for a named (not weak) file: never null.
|
||||
@@ -1402,6 +1405,8 @@ mod image_set_tests {
|
||||
let gb = |n: &str| release_identity("p", &format!(r#"German Board - [Usenet4ever.info] und [SecretUsenet.com] - "{n}" yEnc"#), n);
|
||||
assert_eq!(gb("6c57319fbae505679737bd46a76193a1-u4e.part6.rar").key, gb("6c57319fbae505679737bd46a76193a1-u4e.par2").key);
|
||||
assert_ne!(gb("6c57319fbae505679737bd46a76193a1-u4e.part6.rar").key, gb("6fc0ff192a355703b3e81557893013b1-u4e.part6.rar").key);
|
||||
assert_ne!(gb("21.Jump.Street.2012.BDRip.AC3.German.XviD-POE.part01.rar").key, gb("Ice.Age.4.Voll.verschoben.2012.BDRip.AC3.German.XviD-POE.part01.rar").key);
|
||||
assert_eq!(gb("21.Jump.Street.2012.BDRip.AC3.German.XviD-POE.part01.rar").key, gb("21.Jump.Street.2012.BDRip.AC3.German.XviD-POE.par2").key);
|
||||
let pck = |i: &str, n: &str| release_identity("p", &format!(r#"(????) [{i}/2195] - "{n}" yEnc"#), n);
|
||||
assert_eq!(pck("0659", "DN.VPL PCK.1508").key, pck("0660", "DN.VPL PCK.1509").key);
|
||||
assert_eq!(pck("0659", "DN.VPL PCK.1508").name, "DN.VPL PCK.1508");
|
||||
|
||||
Reference in new issue
Block a user