diff --git a/desktop/src-tauri/src/config.rs b/desktop/src-tauri/src/config.rs index 17058cd..9caae75 100644 --- a/desktop/src-tauri/src/config.rs +++ b/desktop/src-tauri/src/config.rs @@ -53,6 +53,9 @@ pub struct RqbitDesktopConfigPersistence { #[serde(default)] pub folder: PathBuf, + #[serde(default)] + pub fastresume: bool, + /// Deprecated, but keeping for backwards compat for serialized / deserialized config. #[serde(default)] pub filename: PathBuf, @@ -77,6 +80,7 @@ impl Default for RqbitDesktopConfigPersistence { Self { disable: false, folder, + fastresume: false, filename: PathBuf::new(), } } diff --git a/desktop/src-tauri/src/main.rs b/desktop/src-tauri/src/main.rs index 97f2e7c..15ef621 100644 --- a/desktop/src-tauri/src/main.rs +++ b/desktop/src-tauri/src/main.rs @@ -101,6 +101,7 @@ async fn api_from_config( None }, enable_upnp_port_forwarding: !config.upnp.disable, + fastresume: config.persistence.fastresume, ..Default::default() }, ) @@ -138,7 +139,13 @@ impl State { .to_owned(); if let Ok(config) = read_config(&config_filename) { - let api = api_from_config(&init_logging, &config).await.ok(); + let api = api_from_config(&init_logging, &config) + .await + .map_err(|e| { + warn!(error=?e, "error reading configuration"); + e + }) + .ok(); let shared = Arc::new(RwLock::new(Some(StateShared { config, api }))); return Self { diff --git a/desktop/src/configuration.tsx b/desktop/src/configuration.tsx index 9936b5b..0428039 100644 --- a/desktop/src/configuration.tsx +++ b/desktop/src/configuration.tsx @@ -17,6 +17,7 @@ interface RqbitDesktopConfigTcpListen { interface RqbitDesktopConfigPersistence { disable: boolean; folder: PathLike; + fastresume: boolean; } interface RqbitDesktopConfigPeerOpts { diff --git a/desktop/src/configure.tsx b/desktop/src/configure.tsx index acd225e..9b3dddd 100644 --- a/desktop/src/configure.tsx +++ b/desktop/src/configure.tsx @@ -299,6 +299,14 @@ export const ConfigModal: React.FC<{ onChange={handleInputChange} disabled={config.persistence.disable} /> + + diff --git a/desktop/src/main.tsx b/desktop/src/main.tsx index 660d2ba..2f4cc4e 100644 --- a/desktop/src/main.tsx +++ b/desktop/src/main.tsx @@ -19,6 +19,7 @@ async function get_current_config(): Promise { Promise.all([get_version(), get_default_config(), get_current_config()]).then( ([version, defaultConfig, currentState]) => { + console.log(version, defaultConfig, currentState); ReactDOM.createRoot(document.getElementById("root") as HTMLElement).render(