Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Mechanism to upgrade to packages #427

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion src-tauri/src/mod_management/legacy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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,
Expand Down