Identity: other quoted text, text separators, ids in image names, more
- Quoted text other than the file name stays in the remainder: ">>> CREATIVE
COMMONS NZB <<< "0190 alarm 5.0 " - File 1 of 9: "…rar"" made 12,605
files of all uploads one release.
- namesRelease accepts words joined by , & : ; \ / + ("Posting & deleting,
read 0 file "E:\VladModels\y038_Irina\185" …"): such image sets fell to
the stem rule ("P8250001.JPG"), one release over all folders.
- imageSet: a 5+ digit number left in the set is a per-image id
("sss-70556-3474182-23-10825418-pc", "Alena p 26663_…"): no set. Copy
markers may repeat ("diana-050-052[1][1]").
- unquotedName: an image after numbered text without a separator is the
last word ("<abm> … AB: part2 0573-1002 043.jpg").
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
e1d21d1e7c
commit
3fc38edda8
6 files changed
+84
-18
No files matched your search
+18
-1
@@ -296,6 +296,12 @@ pub fn name_beside_quotes(quoted: &str, before_counter: &str) -> Option<String>
|
||||
}
|
||||
|
||||
/// unquotedName (lib/headers/subject.ts): the file name of a subject without a quoted one, from the text before its counter.
|
||||
/// /\.(jpe?g|png|gif|bmp|webp|tiff?)$/i
|
||||
fn is_image_name(name: &str) -> bool {
|
||||
let lower = name.to_ascii_lowercase();
|
||||
[".jpg", ".jpeg", ".png", ".gif", ".bmp", ".webp", ".tif", ".tiff"].iter().any(|e| lower.ends_with(e))
|
||||
}
|
||||
|
||||
pub fn unquoted_name(before_counter: &str) -> Option<String> {
|
||||
let mut text = before_counter.trim_end_matches(js::is_space);
|
||||
if text.len() >= 4 && text.is_char_boundary(text.len() - 4) && text[text.len() - 4..].eq_ignore_ascii_case("yenc") {
|
||||
@@ -340,7 +346,17 @@ pub fn unquoted_name(before_counter: &str) -> Option<String> {
|
||||
let dash = first_track(text).or_else(|| text.rfind(" - ")).map_or(0, |i| i + 3);
|
||||
// Or after an arrow ("… -> Exclusive-tgirls_000000-lg.jpg").
|
||||
let arrow = text.rfind("-> ").map_or(0, |i| i + 3);
|
||||
let name = js::trim(&text[bracket.max(dash).max(arrow)..]);
|
||||
let cut = bracket.max(dash).max(arrow);
|
||||
let name = js::trim(&text[cut..]);
|
||||
// An image after numbered text without a separator: its last word ("<abm> … AB: part2 0573-1002 043.jpg").
|
||||
// Not an index alone ("Teen Tease Self Shooter sad1 (10).jpg").
|
||||
if cut == 0 && is_image_name(name) && name.contains(' ') {
|
||||
let space = name.rfind(' ').unwrap();
|
||||
let last = &name[space + 1..];
|
||||
if name[..space].trim_end_matches(js::is_space).ends_with(|c: char| c.is_ascii_digit()) && !last.starts_with('(') {
|
||||
return Some(last.to_string());
|
||||
}
|
||||
}
|
||||
return (!name.is_empty() && has_extension(name)).then(|| name.to_string());
|
||||
}
|
||||
text.split(' ').find(|w| has_extension(w)).map(str::to_string)
|
||||
@@ -913,6 +929,7 @@ mod unquoted_tests {
|
||||
("pal! [Mivina high(1).wmv\" yEnc] ", Some("Mivina high(1).wmv")),
|
||||
("[03/21 Geroellheimer - S03E16.part01.rar\" yEnc ", Some("Geroellheimer - S03E16.part01.rar")),
|
||||
("<Group> FP -> {EXL01~P~004} -> Alexia (3) -> VF -> [0001 of 0076] -> Exclusive-tgirls_000000-lg.jpg ", Some("Exclusive-tgirls_000000-lg.jpg")),
|
||||
("<abm> <Duke> here's a little thanksgiving present: AB: part2 0573-1002 043.jpg ", Some("043.jpg")),
|
||||
("[7w] - 9BbEV2MrTi59GBTEFlVrssBrXNwXf2SK9cQEeDjg yEnc ", None),
|
||||
("Re: Will somebody answer the question? ", None),
|
||||
];
|
||||
|
||||
Reference in new issue
Block a user