Made changes for Desktop app to work

This commit is contained in:
Igor Katson 2023-12-02 21:12:15 +00:00
parent fe04e17d63
commit 28c2db2a37
No known key found for this signature in database
GPG key ID: B4EC22B66D61A3F5
15 changed files with 74 additions and 38 deletions

View file

@ -143,8 +143,10 @@ impl Api {
info,
only_files,
seen_peers,
output_folder,
}) => ApiAddTorrentResponse {
id: None,
output_folder: output_folder.to_string_lossy().into_owned(),
seen_peers: Some(seen_peers),
details: make_torrent_details(&info_hash, &info, only_files.as_deref())
.context("error making torrent details")?,
@ -159,6 +161,7 @@ impl Api {
ApiAddTorrentResponse {
id: Some(id),
details,
output_folder: handle.info().out_dir.to_string_lossy().into_owned(),
seen_peers: None,
}
}
@ -227,6 +230,7 @@ pub struct TorrentDetailsResponse {
pub struct ApiAddTorrentResponse {
pub id: Option<usize>,
pub details: TorrentDetailsResponse,
pub output_folder: String,
pub seen_peers: Option<Vec<SocketAddr>>,
}