mirror of
https://github.com/YGGverse/btracker.git
synced 2026-03-31 17:15:31 +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) {
|
||||
continue;
|
||||
}
|
||||
if keyword.is_some_and(|k| {
|
||||
!k.is_empty()
|
||||
&& !librqbit_core::torrent_metainfo::torrent_from_bytes(
|
||||
&fs::read(e.path()).unwrap(),
|
||||
)
|
||||
.is_ok_and(
|
||||
if let Some(k) = keyword
|
||||
&& !k.is_empty()
|
||||
&& !librqbit_core::torrent_metainfo::torrent_from_bytes(&fs::read(&p)?).is_ok_and(
|
||||
|m: librqbit_core::torrent_metainfo::TorrentMetaV1Owned| {
|
||||
m.info_hash.as_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;
|
||||
}
|
||||
f.push(File {
|
||||
path: e.path(),
|
||||
path: p,
|
||||
modified: e.metadata()?.modified()?,
|
||||
})
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue