aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeckoEidechse <gecko.eidechse+git@pm.me>2023-07-21 12:44:08 +0200
committerGeckoEidechse <gecko.eidechse+git@pm.me>2023-07-21 12:44:08 +0200
commit4fbb3e2d13d04649a1845d83d59bac7f99f7abe1 (patch)
tree1d344f22e4c56ee0b6d32c2de2249348fce0a3b2
parent17d6282d832ef3a697e2f234aff9d03e55aca27a (diff)
parent5e988a6df608ba11956af54951b50cad2e32e3d9 (diff)
downloadFlightCore-4fbb3e2d13d04649a1845d83d59bac7f99f7abe1.tar.gz
FlightCore-4fbb3e2d13d04649a1845d83d59bac7f99f7abe1.zip
Merge branch 'feat/install-packages' into dev/packages
-rw-r--r--src-tauri/Cargo.lock5
-rw-r--r--src-tauri/Cargo.toml2
-rw-r--r--src-tauri/src/mod_management/legacy.rs4
-rw-r--r--src-tauri/src/mod_management/mod.rs10
4 files changed, 14 insertions, 7 deletions
diff --git a/src-tauri/Cargo.lock b/src-tauri/Cargo.lock
index d57c1752..f01d299b 100644
--- a/src-tauri/Cargo.lock
+++ b/src-tauri/Cargo.lock
@@ -1993,12 +1993,13 @@ checksum = "201de327520df007757c1f0adce6e827fe8562fbc28bfd9c15571c66ca1f5f79"
[[package]]
name = "libthermite"
-version = "0.7.0-alpha"
+version = "0.7.0-beta"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b3927ebe9945316ba6a70f4384045fba7da9261e23b44faa7fddf9238f8916fa"
+checksum = "07d01e44ad3cd57ad026987a2d69a71d7a6d49e5ecdbbe64c2f940477b2a3a2d"
dependencies = [
"flate2",
"json5",
+ "lazy_static",
"regex",
"serde",
"serde_json",
diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml
index 261e0b9d..bba82afc 100644
--- a/src-tauri/Cargo.toml
+++ b/src-tauri/Cargo.toml
@@ -33,7 +33,7 @@ steamlocate = "1.2"
# Error messages
anyhow = "1.0"
# libthermite for Northstar/mod install handling
-libthermite = { version = "0.7.0-alpha", features = ["proton"] }
+libthermite = { version = "0.7.0-beta", features = ["proton"] }
# zip stuff
zip = "0.6.2"
# Regex
diff --git a/src-tauri/src/mod_management/legacy.rs b/src-tauri/src/mod_management/legacy.rs
index cf535000..2a5228fc 100644
--- a/src-tauri/src/mod_management/legacy.rs
+++ b/src-tauri/src/mod_management/legacy.rs
@@ -128,6 +128,10 @@ pub fn parse_installed_mods(
/// Deletes all legacy packages that match in author and mod name
/// regardless of version
+///
+/// "legacy package" refers to a Thunderstore package installed into the `mods` folder
+/// by extracting Northstar mods contained inside and then adding `manifest.json` and `thunderstore_author.txt`
+/// to indicate which Thunderstore package they are part of
pub fn delete_legacy_package_install(
thunderstore_mod_string: &str,
game_install: &GameInstall,
diff --git a/src-tauri/src/mod_management/mod.rs b/src-tauri/src/mod_management/mod.rs
index cef7ff71..c049fe07 100644
--- a/src-tauri/src/mod_management/mod.rs
+++ b/src-tauri/src/mod_management/mod.rs
@@ -444,6 +444,10 @@ fn delete_older_versions(
let ts_mod_string_from_folder: ParsedThunderstoreModString = match folder_name.parse() {
Ok(res) => res,
Err(err) => {
+ // Failed parsing folder name as Thunderstore mod string
+ // This means it doesn't follow the `AUTHOR-MOD-VERSION` naming structure
+ // This folder could've been manually created by the user or another application
+ // As parsing failed we cannot determine the Thunderstore package it is part of hence we skip it
log::warn!("{err}");
continue;
}
@@ -574,13 +578,11 @@ pub async fn fc_download_mod_and_install(
};
// Get directory to install to made up of packages directory and Thunderstore mod string
- let install_directory = format!(
- "{}/R2Northstar/packages/{}",
- game_install.game_path, thunderstore_mod_string
- );
+ let install_directory = format!("{}/R2Northstar/packages/", game_install.game_path);
// Extract the mod to the mods directory
match thermite::core::manage::install_with_sanity(
+ thunderstore_mod_string,
temp_file.file(),
std::path::Path::new(&install_directory),
fc_sanity_check,