Make the announce info field optional
This commit is contained in:
parent
00c7f3150f
commit
b184354c2f
3 changed files with 5 additions and 7 deletions
|
|
@ -200,7 +200,7 @@ pub async fn create_torrent<'a>(
|
|||
let info_hash = compute_info_hash(&info).context("error computing info hash")?;
|
||||
Ok(CreateTorrentResult {
|
||||
meta: TorrentMetaV1Owned {
|
||||
announce: b""[..].into(),
|
||||
announce: None,
|
||||
announce_list: Vec::new(),
|
||||
info,
|
||||
comment: None,
|
||||
|
|
|
|||
|
|
@ -721,10 +721,7 @@ impl Session {
|
|||
.map(|t| ByteString(t.into_bytes()))
|
||||
.collect();
|
||||
let info = TorrentMetaV1Owned {
|
||||
announce: trackers
|
||||
.first()
|
||||
.cloned()
|
||||
.unwrap_or_else(|| ByteString(b"http://retracker.local/announce".to_vec())),
|
||||
announce: trackers.first().cloned(),
|
||||
announce_list: vec![trackers],
|
||||
info: storrent.info,
|
||||
comment: None,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue