fmt
This commit is contained in:
parent
6d08173159
commit
bac364760e
2 changed files with 7 additions and 4 deletions
|
|
@ -1365,7 +1365,9 @@ impl Session {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub async fn pause(&self, handle: &ManagedTorrentHandle) -> anyhow::Result<()> {
|
pub async fn pause(&self, handle: &ManagedTorrentHandle) -> anyhow::Result<()> {
|
||||||
handle.pause().map(|_| handle.locked.write().paused = true)?;
|
handle
|
||||||
|
.pause()
|
||||||
|
.map(|_| handle.locked.write().paused = true)?;
|
||||||
self.try_update_persistence_metadata(handle).await;
|
self.try_update_persistence_metadata(handle).await;
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -302,7 +302,6 @@ struct DownloadOpts {
|
||||||
#[arg(long = "initial-peers")]
|
#[arg(long = "initial-peers")]
|
||||||
initial_peers: Option<InitialPeers>,
|
initial_peers: Option<InitialPeers>,
|
||||||
|
|
||||||
|
|
||||||
#[arg(long = "server-url")]
|
#[arg(long = "server-url")]
|
||||||
server_url: Option<String>,
|
server_url: Option<String>,
|
||||||
}
|
}
|
||||||
|
|
@ -638,7 +637,10 @@ async fn async_main(opts: Opts, cancel: CancellationToken) -> anyhow::Result<()>
|
||||||
if download_opts.torrent_path.is_empty() {
|
if download_opts.torrent_path.is_empty() {
|
||||||
anyhow::bail!("you must provide at least one URL to download")
|
anyhow::bail!("you must provide at least one URL to download")
|
||||||
}
|
}
|
||||||
let http_api_url = download_opts.server_url.clone().unwrap_or_else(|| format!("http://{}", opts.http_api_listen_addr));
|
let http_api_url = download_opts
|
||||||
|
.server_url
|
||||||
|
.clone()
|
||||||
|
.unwrap_or_else(|| format!("http://{}", opts.http_api_listen_addr));
|
||||||
let client = http_api_client::HttpApiClient::new(&http_api_url)?;
|
let client = http_api_client::HttpApiClient::new(&http_api_url)?;
|
||||||
|
|
||||||
let torrent_opts = |with_output_folder: bool| AddTorrentOptions {
|
let torrent_opts = |with_output_folder: bool| AddTorrentOptions {
|
||||||
|
|
@ -668,7 +670,6 @@ async fn async_main(opts: Opts, cancel: CancellationToken) -> anyhow::Result<()>
|
||||||
};
|
};
|
||||||
if !connect_to_existing && download_opts.server_url.is_some() {
|
if !connect_to_existing && download_opts.server_url.is_some() {
|
||||||
anyhow::bail!("cannot connect to server at {}", client.base_url());
|
anyhow::bail!("cannot connect to server at {}", client.base_url());
|
||||||
|
|
||||||
}
|
}
|
||||||
if connect_to_existing {
|
if connect_to_existing {
|
||||||
for torrent_url in &download_opts.torrent_path {
|
for torrent_url in &download_opts.torrent_path {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue