Disable upload: do not expose in default builds, move under a feature flag.
This commit is contained in:
parent
b99a1e2b73
commit
990c5f866b
11 changed files with 45 additions and 16 deletions
|
|
@ -38,3 +38,4 @@ tauri-plugin-shell = "2"
|
|||
# this feature is used for production builds or when `devPath` points to the filesystem
|
||||
# DO NOT REMOVE!!
|
||||
custom-protocol = ["tauri/custom-protocol"]
|
||||
disable-upload = ["librqbit/disable-upload"]
|
||||
|
|
|
|||
|
|
@ -144,6 +144,7 @@ pub struct RqbitDesktopConfigUpnp {
|
|||
pub struct RqbitDesktopConfig {
|
||||
pub default_download_location: PathBuf,
|
||||
|
||||
#[cfg(feature = "disable-upload")]
|
||||
#[serde(default)]
|
||||
pub disable_upload: bool,
|
||||
|
||||
|
|
@ -171,6 +172,7 @@ impl Default for RqbitDesktopConfig {
|
|||
persistence: Default::default(),
|
||||
peer_opts: Default::default(),
|
||||
http_api: Default::default(),
|
||||
#[cfg(feature = "disable-upload")]
|
||||
disable_upload: false,
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -105,6 +105,7 @@ async fn api_from_config(
|
|||
},
|
||||
enable_upnp_port_forwarding: !config.upnp.disable_tcp_port_forward,
|
||||
fastresume: config.persistence.fastresume,
|
||||
#[cfg(feature = "disable-upload")]
|
||||
disable_upload: config.disable_upload,
|
||||
..Default::default()
|
||||
},
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ interface RqbitDesktopConfigUpnp {
|
|||
|
||||
export interface RqbitDesktopConfig {
|
||||
default_download_location: PathLike;
|
||||
disable_upload: boolean;
|
||||
disable_upload?: boolean;
|
||||
dht: RqbitDesktopConfigDht;
|
||||
tcp_listen: RqbitDesktopConfigTcpListen;
|
||||
upnp: RqbitDesktopConfigUpnp;
|
||||
|
|
|
|||
|
|
@ -211,15 +211,18 @@ export const ConfigModal: React.FC<{
|
|||
help="Where to download torrents by default. You can override this per torrent."
|
||||
/>
|
||||
|
||||
<FormCheck
|
||||
label="Disable upload"
|
||||
name="disable_upload"
|
||||
checked={config.disable_upload}
|
||||
onChange={handleToggleChange}
|
||||
help="Disable uploading entirely. If this is set, rqbit won't share piece availability and will disconnect on download request.
|
||||
{defaultConfig.disable_upload !== undefined &&
|
||||
config.disable_upload !== undefined && (
|
||||
<FormCheck
|
||||
label="Disable upload"
|
||||
name="disable_upload"
|
||||
checked={config.disable_upload}
|
||||
onChange={handleToggleChange}
|
||||
help="Disable uploading entirely. If this is set, rqbit won't share piece availability and will disconnect on download request.
|
||||
|
||||
Might be useful e.g. if rqbit upload consumes all your upload bandwidth and interferes with your other Internet usage."
|
||||
/>
|
||||
/>
|
||||
)}
|
||||
</Tab>
|
||||
|
||||
<Tab name="DHT" currentTab={tab}>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue