bep 47: serialize/deserialize new fields

This commit is contained in:
Igor Katson 2024-10-14 14:55:48 +01:00
parent 60cea68985
commit af0389de05
No known key found for this signature in database
GPG key ID: B4EC22B66D61A3F5
3 changed files with 39 additions and 1 deletions

View file

@ -124,7 +124,13 @@ async fn create_torrent_raw<'a>(
.components()
.map(|c| osstr_to_bytes(c.as_os_str()).into())
.collect();
output_files.push(TorrentMetaV1File { length, path });
output_files.push(TorrentMetaV1File {
length,
path,
attr: None,
sha1: None,
symlink_path: None,
});
continue 'outer;
}
@ -154,6 +160,9 @@ async fn create_torrent_raw<'a>(
} else {
Some(output_files)
},
attr: None,
sha1: None,
symlink_path: None,
})
}

View file

@ -402,9 +402,15 @@ mod tests {
.map(|f| TorrentMetaV1File {
length: 1,
path: f.split("/").map(|f| f.as_bytes().into()).collect(),
attr: None,
sha1: None,
symlink_path: None,
})
.collect(),
),
attr: None,
sha1: None,
symlink_path: None,
},
comment: None,
created_by: None,