mirror of
https://github.com/YGGverse/btracker.git
synced 2026-04-01 17:45:36 +00:00
handle fs read errors
This commit is contained in:
parent
4f6af5f03b
commit
6ab12dbaa4
1 changed files with 16 additions and 19 deletions
|
|
@ -110,12 +110,9 @@ impl Public {
|
||||||
if !p.is_file() || p.extension().is_none_or(|e| e != EXTENSION) {
|
if !p.is_file() || p.extension().is_none_or(|e| e != EXTENSION) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if keyword.is_some_and(|k| {
|
if let Some(k) = keyword
|
||||||
!k.is_empty()
|
&& !k.is_empty()
|
||||||
&& !librqbit_core::torrent_metainfo::torrent_from_bytes(
|
&& !librqbit_core::torrent_metainfo::torrent_from_bytes(&fs::read(&p)?).is_ok_and(
|
||||||
&fs::read(e.path()).unwrap(),
|
|
||||||
)
|
|
||||||
.is_ok_and(
|
|
||||||
|m: librqbit_core::torrent_metainfo::TorrentMetaV1Owned| {
|
|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))
|
||||||
|
|
@ -127,12 +124,12 @@ impl Public {
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
) // @TODO implement fast in-memory search index
|
)
|
||||||
}) {
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
f.push(File {
|
f.push(File {
|
||||||
path: e.path(),
|
path: p,
|
||||||
modified: e.metadata()?.modified()?,
|
modified: e.metadata()?.modified()?,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue