iter_file_details_ext update impl

This commit is contained in:
Igor Katson 2024-10-14 15:06:47 +01:00
parent abce0c6629
commit 98f011673e
No known key found for this signature in database
GPG key ID: B4EC22B66D61A3F5
3 changed files with 26 additions and 9 deletions

View file

@ -1144,10 +1144,10 @@ impl Session {
.iter_file_details_ext(&lengths)?
.map(|fd| {
Ok::<_, anyhow::Error>(FileInfo {
relative_filename: fd.filename.to_pathbuf()?,
offset_in_torrent: fd.offset,
relative_filename: fd.details.filename.to_pathbuf()?,
offset_in_torrent: fd.details.offset,
piece_range: fd.pieces,
len: fd.len,
len: fd.details.len,
})
})
.collect::<anyhow::Result<Vec<FileInfo>>>()?;

View file

@ -154,6 +154,7 @@ impl TorrentStorage for FilesystemStorage {
for file_details in meta.info.iter_file_details_ext(&meta.lengths)? {
let mut full_path = self.output_folder.clone();
let relative_path = file_details
.details
.filename
.to_pathbuf()
.context("error converting file to path")?;