Identity: a set's number before yEnc is no size; names after an arrow
Test and deploy / test (push) Successful in 49s
Test and deploy / edge (push) Successful in 1m59s
Test and deploy / deploy (push) Successful in 2m6s

- 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:
Daan MeijerandClaude Opus 5.5 committed 2026-10-12 06:46:19 +02:00
1 parent 18a146e130
commit e1d21d1e7c
6 files changed
+37 -5

No files matched your search

+13 -1
View File
@@ -360,6 +360,11 @@ fn strip_number_before_yenc(s: &str) -> String {
if digits_start > 0 && (b[digits_start - 1].is_ascii_alphanumeric() || b[digits_start - 1] == b'_') {
return s.to_string();
}
// A short number after a word is a set's ("… set 1 [1 of 60] "destiny-001-001.jpg" yEnc"), not a size.
let word_before = b[..digits_start].iter().rev().find(|&&c| !js::is_space(c as char)).is_some_and(|c| c.is_ascii_alphanumeric());
if digits_end - digits_start < 4 && word_before {
return s.to_string();
}
format!("{}{}", &s[..digits_start], &s[digits_end..])
}
@@ -1273,7 +1278,14 @@ mod image_set_tests {
let a = release_identity(mb, r#"Herb Ernst@256 - NMR -[07/17] "Herb Ernst - Dreamflight II - 05 - The Light of Forever.mp3" - 8123 yEnc"#, "Herb Ernst - Dreamflight II - 05 - The Light of Forever.mp3");
let b = release_identity(mb, r#"Herb Ernst@256 - NMR -[08/17] "Herb Ernst - Dreamflight II - 06 - Other.mp3" - 9001 yEnc"#, "Herb Ernst - Dreamflight II - 06 - Other.mp3");
assert_eq!(a.key, b.key);
for s in [r#"x - "a.mp3" - 8123 yEnc"#, "a8123 yEnc", "-8123 yEnc ", "yEnc"] {
let destiny = |set: u32, i: u32| {
let name = format!("destiny-{set:03}-{i:03}.jpg");
release_identity("p", &format!(r#"Newstar Destiny I set {set} [{i} of 60] "{name}" yEnc"#), &name)
};
assert_eq!(destiny(1, 1).key, destiny(1, 2).key);
assert_ne!(destiny(1, 1).key, destiny(63, 34).key);
assert_eq!(destiny(63, 34).name, "Newstar Destiny I set 63");
for s in [r#"x - "a.mp3" - 8123 yEnc"#, "a8123 yEnc", "-8123 yEnc ", "yEnc", r#"set 1 [1 of 60] "x.jpg" yEnc"#, "Album 12 yEnc", "Album 1234 yEnc"] {
assert_eq!(super::subject_remainder(s), super::subject_remainder_re(s), "{s}");
}
assert!(random_poster("SOFZRw1-OTEd@EEFUbh.srG"));