mirror of
https://github.com/YGGverse/btracker.git
synced 2026-03-31 17:15:31 +00:00
make search query case insensitive
This commit is contained in:
parent
255a48bb58
commit
5f0562cd48
1 changed files with 8 additions and 4 deletions
|
|
@ -114,13 +114,17 @@ impl Public {
|
||||||
&& !k.is_empty()
|
&& !k.is_empty()
|
||||||
&& !librqbit_core::torrent_metainfo::torrent_from_bytes(&fs::read(&path)?)
|
&& !librqbit_core::torrent_metainfo::torrent_from_bytes(&fs::read(&path)?)
|
||||||
.is_ok_and(|m: librqbit_core::torrent_metainfo::TorrentMetaV1Owned| {
|
.is_ok_and(|m: librqbit_core::torrent_metainfo::TorrentMetaV1Owned| {
|
||||||
m.info_hash.as_string().contains(k)
|
let q = k.to_lowercase();
|
||||||
|| m.info.name.is_some_and(|n| n.to_string().contains(k))
|
m.info_hash.as_string().to_lowercase().contains(&q)
|
||||||
|
|| m.info
|
||||||
|
.name
|
||||||
|
.is_some_and(|n| n.to_string().to_lowercase().contains(&q))
|
||||||
|| m.info.files.is_some_and(|f| {
|
|| m.info.files.is_some_and(|f| {
|
||||||
f.iter().any(|f| {
|
f.iter().any(|f| {
|
||||||
let mut p = PathBuf::new();
|
let mut p = PathBuf::new();
|
||||||
f.full_path(&mut p)
|
f.full_path(&mut p).is_ok_and(|_| {
|
||||||
.is_ok_and(|_| p.to_string_lossy().contains(k))
|
p.to_string_lossy().to_lowercase().contains(&q)
|
||||||
|
})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue