model: add file_count_preference for multi-file selection support

Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: Ia27c829dbcc21a7fcfc8e6f67f9e33276a6a6964
This commit is contained in:
raf 2026-02-28 23:40:34 +03:00
commit a89184a358
Signed by: NotAShelf
GPG key ID: 29D95B64378DB4BF
4 changed files with 19 additions and 5 deletions

View file

@ -64,6 +64,9 @@ pub struct Config {
rename = "exportServerSideProjectsToClient"
)]
pub export_server_side_projects_to_client: Option<bool>,
/// Number of files to select per project (defaults to 1)
#[serde(skip_serializing_if = "Option::is_none")]
pub file_count_preference: Option<usize>,
}
impl Default for Config {
@ -80,6 +83,7 @@ impl Default for Config {
projects: Some(HashMap::new()),
export_profiles: None,
export_server_side_projects_to_client: None,
file_count_preference: None,
}
}
}
@ -145,6 +149,7 @@ impl Config {
projects: Some(pakku.projects),
export_profiles: None,
export_server_side_projects_to_client: None,
file_count_preference: None,
})
},
Err(e) => Err(PakkerError::InvalidConfigFile(e.to_string())),
@ -203,6 +208,7 @@ mod tests {
projects: None,
export_profiles: None,
export_server_side_projects_to_client: None,
file_count_preference: None,
};
assert_eq!(config.name, "test-pack");
assert_eq!(config.version, "1.0.0");
@ -224,6 +230,7 @@ mod tests {
projects: None,
export_profiles: None,
export_server_side_projects_to_client: None,
file_count_preference: None,
};
config.description = Some("A test modpack".to_string());
config.author = Some("Test Author".to_string());