aboutsummaryrefslogtreecommitdiff
path: root/src-tauri/src
diff options
context:
space:
mode:
authorGeckoEidechse <gecko.eidechse+git@pm.me>2023-07-18 15:21:35 +0200
committerGeckoEidechse <gecko.eidechse+git@pm.me>2023-07-18 15:21:35 +0200
commit24090dd1a134b593aa0a77180f2ae16fab3227a0 (patch)
tree277ba5483df50eed3b867469a165ee09c7f8d330 /src-tauri/src
parent9dccdb0b0335f82aa9f2e63642f16ff0f2699528 (diff)
downloadFlightCore-24090dd1a134b593aa0a77180f2ae16fab3227a0.tar.gz
FlightCore-24090dd1a134b593aa0a77180f2ae16fab3227a0.zip
feat: Give wrong version number on legacy TS mods
to prompt to "update" mod
Diffstat (limited to 'src-tauri/src')
-rw-r--r--src-tauri/src/mod_management/legacy.rs13
1 files changed, 12 insertions, 1 deletions
diff --git a/src-tauri/src/mod_management/legacy.rs b/src-tauri/src/mod_management/legacy.rs
index f24f44b6..568aadfc 100644
--- a/src-tauri/src/mod_management/legacy.rs
+++ b/src-tauri/src/mod_management/legacy.rs
@@ -88,7 +88,7 @@ pub fn parse_installed_mods(
}
};
// Get Thunderstore mod string if it exists
- let thunderstore_mod_string = match parsed_mod_json.thunderstore_mod_string {
+ let mut thunderstore_mod_string = match parsed_mod_json.thunderstore_mod_string {
// Attempt legacy method for getting Thunderstore string first
Some(ts_mod_string) => Some(ts_mod_string),
// Legacy method failed
@@ -100,6 +100,17 @@ pub fn parse_installed_mods(
// Get directory path
let mod_directory = directory.to_str().unwrap().to_string();
+ // This is a stupid way to show a legacy installed mod as outdated by simply giving back a wrong version number
+ if thunderstore_mod_string.is_some() {
+ // Parse the string
+ let mut parsed_string: ParsedThunderstoreModString =
+ thunderstore_mod_string.clone().unwrap().parse().unwrap();
+ // Set version number to `0.0.0`
+ parsed_string.version = "0.0.0".to_string();
+ // And store new string back in original variable
+ thunderstore_mod_string = Some(parsed_string.to_string())
+ }
+
let ns_mod = NorthstarMod {
name: parsed_mod_json.name,
version: parsed_mod_json.version,