mirror of
https://github.com/YGGverse/aquatic-crawler.git
synced 2026-03-31 17:15:35 +00:00
add missed directory separators
This commit is contained in:
parent
7306a29d1e
commit
7592f7a106
1 changed files with 16 additions and 2 deletions
18
src/main.rs
18
src/main.rs
|
|
@ -359,8 +359,22 @@ fn list(info: &TorrentMetaV1Info<ByteBufOwned>, limit: usize) -> Option<Vec<(Str
|
||||||
t += 1;
|
t += 1;
|
||||||
if t < limit {
|
if t < limit {
|
||||||
b.push((
|
b.push((
|
||||||
String::from_utf8(f.path.iter().flat_map(|b| b.0.to_vec()).collect())
|
String::from_utf8(
|
||||||
.unwrap_or_default(),
|
f.path
|
||||||
|
.iter()
|
||||||
|
.enumerate()
|
||||||
|
.flat_map(|(n, b)| {
|
||||||
|
if n == 0 {
|
||||||
|
b.0.to_vec()
|
||||||
|
} else {
|
||||||
|
let mut p = vec![b'/'];
|
||||||
|
p.extend(b.0.to_vec());
|
||||||
|
p
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.collect(),
|
||||||
|
)
|
||||||
|
.unwrap_or_default(),
|
||||||
f.length,
|
f.length,
|
||||||
));
|
));
|
||||||
continue;
|
continue;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue