compute "attrs" field
This commit is contained in:
parent
ab173c00f6
commit
2e7c7216e3
3 changed files with 5 additions and 1 deletions
|
|
@ -1,10 +1,13 @@
|
||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
|
|
||||||
|
use librqbit_core::torrent_metainfo::FileDetailsAttrs;
|
||||||
|
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone)]
|
||||||
pub struct FileInfo {
|
pub struct FileInfo {
|
||||||
pub relative_filename: PathBuf,
|
pub relative_filename: PathBuf,
|
||||||
pub offset_in_torrent: u64,
|
pub offset_in_torrent: u64,
|
||||||
pub piece_range: std::ops::Range<u32>,
|
pub piece_range: std::ops::Range<u32>,
|
||||||
|
pub attrs: FileDetailsAttrs,
|
||||||
pub len: u64,
|
pub len: u64,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1149,6 +1149,7 @@ impl Session {
|
||||||
offset_in_torrent: fd.offset,
|
offset_in_torrent: fd.offset,
|
||||||
piece_range: fd.pieces,
|
piece_range: fd.pieces,
|
||||||
len: fd.details.len,
|
len: fd.details.len,
|
||||||
|
attrs: fd.details.attrs(),
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
.collect::<anyhow::Result<Vec<FileInfo>>>()?;
|
.collect::<anyhow::Result<Vec<FileInfo>>>()?;
|
||||||
|
|
|
||||||
|
|
@ -181,7 +181,7 @@ where
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Default)]
|
#[derive(Default, Debug, Clone, Copy)]
|
||||||
pub struct FileDetailsAttrs {
|
pub struct FileDetailsAttrs {
|
||||||
pub symlink: bool,
|
pub symlink: bool,
|
||||||
pub hidden: bool,
|
pub hidden: bool,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue