Fix for redownload invalid chunks (#84)

* feat: Redownloading invalid chunks

Signed-off-by: quexeky <git@quexeky.dev>

* fix: clippy

* fix: clippy x2

---------

Signed-off-by: quexeky <git@quexeky.dev>
Co-authored-by: quexeky <git@quexeky.dev>
This commit is contained in:
DecDuck
2025-07-31 18:25:38 +10:00
committed by GitHub
parent d0e4aea5ce
commit b5a8543194
7 changed files with 66 additions and 54 deletions

View File

@ -18,7 +18,7 @@ use crate::remote::requests::make_request;
use log::{debug, error, info};
use rayon::ThreadPoolBuilder;
use std::collections::HashMap;
use std::fs::{create_dir_all, OpenOptions};
use std::fs::{OpenOptions, create_dir_all};
use std::path::{Path, PathBuf};
use std::sync::mpsc::Sender;
use std::sync::{Arc, Mutex};
@ -26,7 +26,7 @@ use std::time::Instant;
use tauri::{AppHandle, Emitter};
#[cfg(target_os = "linux")]
use rustix::fs::{fallocate, FallocateFlags};
use rustix::fs::{FallocateFlags, fallocate};
use super::download_logic::download_game_chunk;
use super::drop_data::DropData;
@ -187,10 +187,7 @@ impl GameDownloadAgent {
self.generate_contexts()?;
}
self.context_map
.lock()
.unwrap()
.extend(self.stored_manifest.get_contexts());
*self.context_map.lock().unwrap() = self.stored_manifest.get_contexts();
Ok(())
}
@ -423,6 +420,7 @@ impl Downloadable for GameDownloadAgent {
app_handle,
)
.unwrap();
println!("Attempting to redownload");
}
fn on_cancelled(&self, _app_handle: &tauri::AppHandle) {}