mirror of
https://github.com/YGGverse/btracker.git
synced 2026-03-31 17:15:31 +00:00
explain some variables
This commit is contained in:
parent
6ab12dbaa4
commit
3fab9b40bf
1 changed files with 9 additions and 10 deletions
|
|
@ -104,16 +104,16 @@ impl Public {
|
||||||
sort_order: Option<(Sort, Order)>,
|
sort_order: Option<(Sort, Order)>,
|
||||||
) -> Result<Vec<File>, Error> {
|
) -> Result<Vec<File>, Error> {
|
||||||
let mut f = Vec::with_capacity(self.default_capacity);
|
let mut f = Vec::with_capacity(self.default_capacity);
|
||||||
for entry in fs::read_dir(&self.root)? {
|
for dir_entry in fs::read_dir(&self.root)? {
|
||||||
let e = entry?;
|
let entry = dir_entry?;
|
||||||
let p = e.path();
|
let path = entry.path();
|
||||||
if !p.is_file() || p.extension().is_none_or(|e| e != EXTENSION) {
|
if !path.is_file() || path.extension().is_none_or(|e| e != EXTENSION) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if let Some(k) = keyword
|
if let Some(k) = keyword
|
||||||
&& !k.is_empty()
|
&& !k.is_empty()
|
||||||
&& !librqbit_core::torrent_metainfo::torrent_from_bytes(&fs::read(&p)?).is_ok_and(
|
&& !librqbit_core::torrent_metainfo::torrent_from_bytes(&fs::read(&path)?)
|
||||||
|m: librqbit_core::torrent_metainfo::TorrentMetaV1Owned| {
|
.is_ok_and(|m: librqbit_core::torrent_metainfo::TorrentMetaV1Owned| {
|
||||||
m.info_hash.as_string().contains(k)
|
m.info_hash.as_string().contains(k)
|
||||||
|| m.info.name.is_some_and(|n| n.to_string().contains(k))
|
|| m.info.name.is_some_and(|n| n.to_string().contains(k))
|
||||||
|| m.info.files.is_some_and(|f| {
|
|| m.info.files.is_some_and(|f| {
|
||||||
|
|
@ -123,14 +123,13 @@ impl Public {
|
||||||
.is_ok_and(|_| p.to_string_lossy().contains(k))
|
.is_ok_and(|_| p.to_string_lossy().contains(k))
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
},
|
})
|
||||||
)
|
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
f.push(File {
|
f.push(File {
|
||||||
path: p,
|
modified: entry.metadata()?.modified()?,
|
||||||
modified: e.metadata()?.modified()?,
|
path,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
if let Some((sort, order)) = sort_order {
|
if let Some((sort, order)) = sort_order {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue