Skip to content
Merged
Show file tree
Hide file tree
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
3 changes: 3 additions & 0 deletions src/add.rs
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,7 @@ pub async fn github(
profile.push_mod(
id.1.as_ref().trim().to_string(),
ModIdentifier::GitHubRepository(id.0.to_string(), id.1.to_string()),
id.1.as_ref().trim().to_string(),
override_profile,
filters,
);
Expand Down Expand Up @@ -424,6 +425,7 @@ pub async fn modrinth(
profile.push_mod(
project.title.trim().to_owned(),
ModIdentifier::ModrinthProject(project.id.clone()),
project.slug.to_owned(),
override_profile,
filters,
);
Expand Down Expand Up @@ -503,6 +505,7 @@ pub async fn curseforge(
profile.push_mod(
project.name.trim().to_string(),
ModIdentifier::CurseForgeProject(project.id),
project.slug.clone(),
override_profile,
filters,
);
Expand Down
8 changes: 8 additions & 0 deletions src/config/structs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,13 @@ impl Profile {
&mut self,
name: String,
identifier: ModIdentifier,
slug: String,
override_filters: bool,
filters: Vec<Filter>,
) {
self.mods.push(Mod {
name,
slug: Some(slug),
identifier,
filters,
override_filters,
Expand All @@ -127,6 +129,11 @@ pub struct Mod {
pub name: String,
pub identifier: ModIdentifier,

// Is an `Option` for backwards compatibility reasons,
// since the slug field didn't exist in older ferium versions
#[serde(skip_serializing_if = "Option::is_none")]
pub slug: Option<String>,

/// Custom filters that apply only for this mod
#[serde(skip_serializing_if = "Vec::is_empty")]
#[serde(default)]
Expand All @@ -153,6 +160,7 @@ impl Mod {
) -> Self {
Self {
name,
slug: None,
identifier,
filters,
override_filters,
Expand Down