Make the update checker work for non-mods (#3088)

* Fix https://github.com/modrinth/code/issues/1057

* Make sure mods use the installed loader

* Switch &PathBuf to &Path

* Clippy fix

* Deduplicate some code

---------

Co-authored-by: Jai Agrawal <18202329+Geometrically@users.noreply.github.com>
This commit is contained in:
Josiah Glosson
2024-12-28 21:23:27 -06:00
committed by GitHub
parent 8b7547ae38
commit 01fe08f079
4 changed files with 80 additions and 41 deletions

View File

@@ -1,4 +1,4 @@
use crate::data::{Dependency, User, Version};
use crate::data::{Dependency, ProjectType, User, Version};
use crate::jre::check_jre;
use crate::prelude::ModLoader;
use crate::state;
@@ -226,6 +226,7 @@ where
path: file_name,
size: metadata.len(),
hash: sha1.clone(),
project_type: ProjectType::get_from_parent_folder(&full_path),
},
));
}
@@ -249,9 +250,9 @@ where
.metadata
.game_version
.clone(),
loader: mod_loader
loaders: vec![mod_loader
.as_str()
.to_string(),
.to_string()],
update_version_id:
update_version.id.clone(),
},