diff --git a/desktop/src-tauri/src/downloads/download_logic.rs b/desktop/src-tauri/src/downloads/download_logic.rs index bbd1c648..fa64f1c1 100644 --- a/desktop/src-tauri/src/downloads/download_logic.rs +++ b/desktop/src-tauri/src/downloads/download_logic.rs @@ -34,7 +34,8 @@ pub fn download_game_chunk(ctx: DropDownloadContext) { .expect("Failed to seek to file offset"); } - let mut stream = BufWriter::with_capacity(1024, file_lock.try_clone().unwrap()); + let mut stream = BufWriter::with_capacity(1024 * 1024, file_lock.try_clone().unwrap()); + drop(file_lock); response.copy_to(&mut stream).unwrap(); } diff --git a/desktop/src-tauri/src/downloads/download_manager.rs b/desktop/src-tauri/src/downloads/download_manager.rs index be0be957..50af71df 100644 --- a/desktop/src-tauri/src/downloads/download_manager.rs +++ b/desktop/src-tauri/src/downloads/download_manager.rs @@ -64,6 +64,7 @@ impl GameDownloadManager { } self.ensure_manifest_exists().await } + pub fn begin_download( &self, max_threads: usize, @@ -76,6 +77,7 @@ impl GameDownloadManager { progress.run_contexts_parallel(contexts, max_threads); Ok(()) } + pub async fn ensure_manifest_exists(&self) -> Result<(), GameDownloadError> { if self.manifest.lock().unwrap().is_some() { return Ok(()); @@ -145,9 +147,6 @@ pub fn generate_job_contexts( let mut running_offset = 0; for i in 0..chunk.ids.len() { - if i == 1 { - info!("woah a chunk bigger than 1") - } contexts.push(DropDownloadContext { file_name: raw_path.to_string(), version: version.to_string(),