mirror of
https://github.com/YGGverse/btracker.git
synced 2026-04-01 17:45:36 +00:00
handle images only
This commit is contained in:
parent
11d41d8bf6
commit
1978a05a82
1 changed files with 8 additions and 8 deletions
16
src/main.rs
16
src/main.rs
|
|
@ -161,14 +161,6 @@ async fn main() -> Result<()> {
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if preload.max_filesize.is_some_and(|limit| info.len > limit) {
|
|
||||||
if config.debug {
|
|
||||||
println!(
|
|
||||||
"\t\t\ttotal files size limit `{i}` reached!"
|
|
||||||
)
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
if info.relative_filename.extension().is_none_or(|e|
|
if info.relative_filename.extension().is_none_or(|e|
|
||||||
!matches!(e.as_bytes(), b"png" | b"jpeg" | b"jpg" | b"gif" | b"webp")) {
|
!matches!(e.as_bytes(), b"png" | b"jpeg" | b"jpg" | b"gif" | b"webp")) {
|
||||||
if config.debug {
|
if config.debug {
|
||||||
|
|
@ -179,6 +171,14 @@ async fn main() -> Result<()> {
|
||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
if preload.max_filesize.is_some_and(|limit| info.len > limit) {
|
||||||
|
if config.debug {
|
||||||
|
println!(
|
||||||
|
"\t\t\ttotal files size limit `{i}` reached!"
|
||||||
|
)
|
||||||
|
}
|
||||||
|
continue;
|
||||||
|
}
|
||||||
images.insert(info.relative_filename.clone(), info.len);
|
images.insert(info.relative_filename.clone(), info.len);
|
||||||
assert!(update_only_files.insert(id))
|
assert!(update_only_files.insert(id))
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue