added: Fabric/Quilt raw-bytes profile storage + migration fix

stop re-serializing FabricProfile/QuiltProfile through narrow structs;
new fetch_X_profile_with_raw helpers return both the parsed shape (for
library downloads) and the upstream bytes (written byte-for-byte to the
loader-profiles cache). also fixes a latent issue surfaced by the
change: the legacy-loader migration predicate now skips Fabric and Quilt
explicitly since their upstream shape matches the predicate but they
have no installer JSON to recover from.
This commit is contained in:
objz committed 2026-05-25 16:56:13 +02:00
1 parent 8d2b5b9832
commit a7b378b17d
6 files changed
+164 -13

No files matched your search

+6 -6
View File
@@ -41,14 +41,14 @@ impl ModLoaderInstaller for QuiltInstaller {
_instance_dir: &Path,
meta_dir: &Path,
) -> Result<(), NetError> {
let profile = quilt_api::fetch_quilt_profile(client, game_version, loader_version).await?;
let (profile, raw_bytes) =
quilt_api::fetch_quilt_profile_with_raw(client, game_version, loader_version).await?;
quilt_api::download_quilt_libraries(client, &profile, meta_dir).await?;
super::save_profile_json(
meta_dir,
&format!("quilt-{game_version}-{loader_version}.json"),
&profile,
)?;
let profiles_dir = meta_dir.join("loader-profiles");
std::fs::create_dir_all(&profiles_dir)?;
let profile_path = profiles_dir.join(format!("quilt-{game_version}-{loader_version}.json"));
std::fs::write(&profile_path, &raw_bytes)?;
Ok(())
}