Stems: keyed without case and a scene index's 00-
"00-laura_van_dam_-_capture_radio_113-cable-10-10-2026-talion.m3u" and .sfv beside "Laura_van_Dam_-_Capture_Radio_113-CABLE-10-10-2026-TALiON.par2" were two releases of one upload (160731958, 160731584). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
123ed81782
commit
1cb6a4554f
3 files changed
+26
-2
No files matched your search
+15
-1
@@ -731,7 +731,12 @@ pub fn release_identity(poster: &str, subject: &str, name: &str) -> Release {
|
||||
(Some(c), Some(total)) if number(&c[2]) <= total as f64 => String::from_utf8(c[1].to_vec()).unwrap(),
|
||||
_ => stem.clone(),
|
||||
};
|
||||
Release { key: hash(&["stem", poster, &base]), name: stem, source: "stem", file_total }
|
||||
// Without case and a scene index's "00-" ("00-laura_van_dam_-_…-talion.m3u" beside "Laura_van_Dam_-_…-TALiON.par2").
|
||||
let lower = base.to_lowercase();
|
||||
let b = lower.as_bytes();
|
||||
let index = if b.starts_with(b"00") { 2 + b[2..].iter().take_while(|c| matches!(c, b'-' | b'_' | b' ' | b'.')).count() } else { 0 };
|
||||
let key_stem = if index > 2 { &lower[index..] } else { &lower[..] };
|
||||
Release { key: hash(&["stem", poster, key_stem]), name: stem, source: "stem", file_total }
|
||||
}
|
||||
|
||||
static SIZE_AFTER_COUNTER: LazyLock<Regex> = LazyLock::new(|| re(r"(\[[0-9]+/[0-9]+\])SP*-SP*\[[0-9]+\]"));
|
||||
@@ -1296,6 +1301,15 @@ mod image_set_tests {
|
||||
assert_ne!(vlad("185", 77, "P8250001.JPG").key, vlad("234", 77, "P5300085.JPG").key);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn scene_index_files_go_with_the_release() {
|
||||
let p = "SavageCobra <x@y.nhc>";
|
||||
let a = release_identity(p, "00-laura_van_dam_-_capture_radio_113-cable-10-10-2026-talion.m3u", "00-laura_van_dam_-_capture_radio_113-cable-10-10-2026-talion.m3u");
|
||||
let b = release_identity(p, "Laura_van_Dam_-_Capture_Radio_113-CABLE-10-10-2026-TALiON.vol000+001.par2", "Laura_van_Dam_-_Capture_Radio_113-CABLE-10-10-2026-TALiON.vol000+001.par2");
|
||||
assert_eq!(a.key, b.key);
|
||||
assert_eq!(b.name, "Laura_van_Dam_-_Capture_Radio_113-CABLE-10-10-2026-TALiON");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn split_rar_volumes_and_sizes_after_the_counter() {
|
||||
assert_eq!(super::file_stem("rld-gtre.r13.002"), "rld-gtre");
|
||||
|
||||
Reference in new issue
Block a user