Update: add sub_folder in AddTorrentOptions
This commit is contained in:
parent
967a06a196
commit
681e93a066
3 changed files with 7 additions and 1 deletions
|
|
@ -124,6 +124,7 @@ pub struct AddTorrentOptions {
|
|||
pub overwrite: bool,
|
||||
pub list_only: bool,
|
||||
pub output_folder: Option<String>,
|
||||
pub sub_folder: Option<String>,
|
||||
pub peer_opts: Option<PeerConnectionOptions>,
|
||||
pub force_tracker_interval: Option<Duration>,
|
||||
}
|
||||
|
|
@ -318,10 +319,12 @@ impl Session {
|
|||
}));
|
||||
}
|
||||
|
||||
let sub_folder = opts.sub_folder.map(PathBuf::from).unwrap_or_default();
|
||||
let output_folder = opts
|
||||
.output_folder
|
||||
.map(PathBuf::from)
|
||||
.unwrap_or_else(|| self.output_folder.clone());
|
||||
.unwrap_or_else(|| self.output_folder.clone())
|
||||
.join(sub_folder.as_path());
|
||||
|
||||
let managed_torrent = ManagedTorrent {
|
||||
info_hash,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue