This commit is contained in:
2026-02-26 20:12:25 +01:00
parent 4318927060
commit 86d0f93ede
9 changed files with 576 additions and 758 deletions
+7 -8
View File
@@ -11,10 +11,7 @@ use crate::{
download::download_game_files,
identity::FEATURE_LIBRARY_DELTA,
local_games::{
LocalLibraryScan,
get_game_file_descriptions,
local_download_available,
scan_local_library,
LocalLibraryScan, get_game_file_descriptions, local_download_available, scan_local_library,
},
network::{announce_games_to_peer, request_game_details_from_peer, send_library_delta},
peer_db::{PeerGameDB, PeerId},
@@ -218,10 +215,13 @@ pub async fn handle_download_game_files_command(
return;
}
let downloading = ctx.downloading_games.read().await;
let local_dl_available = {
let downloading = ctx.downloading_games.read().await;
local_download_available(&games_folder, &id, &downloading).await
};
if peer_whitelist.is_empty() {
if local_download_available(&games_folder, &id, &downloading).await {
drop(downloading);
if local_dl_available {
log::info!("Using locally downloaded files for game {id}; skipping peer transfer");
if let Err(e) = tx_notify_ui.send(PeerEvent::DownloadGameFilesBegin { id: id.clone() })
{
@@ -237,7 +237,6 @@ pub async fn handle_download_game_files_command(
}
return;
}
drop(downloading);
{
let mut in_progress = ctx.downloading_games.write().await;