mirror of
				https://github.com/WarrenHood/MCModpackManager.git
				synced 2025-11-04 08:18:40 +00:00 
			
		
		
		
	Preserve game and loader overrides for automatic transitive deps
This commit is contained in:
		
							parent
							
								
									a6b8a353d4
								
							
						
					
					
						commit
						a2c50b743a
					
				| 
						 | 
					@ -16,7 +16,7 @@ pub struct Modrinth {
 | 
				
			||||||
struct ModrinthProject {
 | 
					struct ModrinthProject {
 | 
				
			||||||
    slug: String,
 | 
					    slug: String,
 | 
				
			||||||
    client_side: String,
 | 
					    client_side: String,
 | 
				
			||||||
    server_side: String
 | 
					    server_side: String,
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#[derive(Serialize, Deserialize, Debug)]
 | 
					#[derive(Serialize, Deserialize, Debug)]
 | 
				
			||||||
| 
						 | 
					@ -90,17 +90,27 @@ impl Modrinth {
 | 
				
			||||||
                project_id,
 | 
					                project_id,
 | 
				
			||||||
                pack_meta,
 | 
					                pack_meta,
 | 
				
			||||||
                false, // TODO: Change this to allow specific versions of mods for the wrong version to be installed
 | 
					                false, // TODO: Change this to allow specific versions of mods for the wrong version to be installed
 | 
				
			||||||
                loader_override,
 | 
					                loader_override.clone(),
 | 
				
			||||||
                game_version_override,
 | 
					                game_version_override.clone(),
 | 
				
			||||||
            )
 | 
					            )
 | 
				
			||||||
            .await?;
 | 
					            .await?;
 | 
				
			||||||
        let project_slug = self.get_project(project_id).await?.slug;
 | 
					        let project_slug = self.get_project(project_id).await?.slug;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        for version in project_versions.iter() {
 | 
					        for version in project_versions.iter() {
 | 
				
			||||||
            if project_version.is_none() || project_version.unwrap_or("*") == version.id {
 | 
					            if project_version.is_none() || project_version.unwrap_or("*") == version.id {
 | 
				
			||||||
                return Ok(ModMeta::new(&project_slug)?
 | 
					                let mut mod_meta = ModMeta::new(&project_slug)?
 | 
				
			||||||
                    .provider(ModProvider::Modrinth)
 | 
					                    .provider(ModProvider::Modrinth)
 | 
				
			||||||
                    .version(&version.version_number.to_string()));
 | 
					                    .version(&version.version_number.to_string());
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                if let Some(loader) = loader_override {
 | 
				
			||||||
 | 
					                    mod_meta.loader = Some(loader.clone());
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                if let Some(mc_version) = game_version_override {
 | 
				
			||||||
 | 
					                    mod_meta = mod_meta.mc_version(&mc_version);
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                return Ok(mod_meta);
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        Err(format!(
 | 
					        Err(format!(
 | 
				
			||||||
| 
						 | 
					@ -171,7 +181,7 @@ impl Modrinth {
 | 
				
			||||||
                    url: f.url.clone(),
 | 
					                    url: f.url.clone(),
 | 
				
			||||||
                    sha1: f.hashes.sha1.clone(),
 | 
					                    sha1: f.hashes.sha1.clone(),
 | 
				
			||||||
                    sha512: f.hashes.sha512.clone(),
 | 
					                    sha512: f.hashes.sha512.clone(),
 | 
				
			||||||
                    filename: f.filename.clone()
 | 
					                    filename: f.filename.clone(),
 | 
				
			||||||
                })
 | 
					                })
 | 
				
			||||||
                .collect(),
 | 
					                .collect(),
 | 
				
			||||||
            version: package.version_number.clone(),
 | 
					            version: package.version_number.clone(),
 | 
				
			||||||
| 
						 | 
					@ -185,7 +195,7 @@ impl Modrinth {
 | 
				
			||||||
                None
 | 
					                None
 | 
				
			||||||
            },
 | 
					            },
 | 
				
			||||||
            server_side: project.server_side != "unsupported",
 | 
					            server_side: project.server_side != "unsupported",
 | 
				
			||||||
            client_side: project.client_side != "unsupported"
 | 
					            client_side: project.client_side != "unsupported",
 | 
				
			||||||
        })
 | 
					        })
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue