Add Embedded dependency type (#380)

* Add Embedded dependency type

I couldn't find any SQL tables or anything for dependency types, so I'm going to assume there aren't any

* Make modpacks use Embedded instead of Required

Co-authored-by: Geometrically <18202329+Geometrically@users.noreply.github.com>
This commit is contained in:
Emma Cypress
2022-06-26 02:16:46 +00:00
committed by GitHub
parent 932b0ccf24
commit 16e7194dfe
2 changed files with 6 additions and 3 deletions

View File

@@ -445,6 +445,7 @@ pub enum DependencyType {
Required, Required,
Optional, Optional,
Incompatible, Incompatible,
Embedded,
} }
impl std::fmt::Display for DependencyType { impl std::fmt::Display for DependencyType {
@@ -460,6 +461,7 @@ impl DependencyType {
DependencyType::Required => "required", DependencyType::Required => "required",
DependencyType::Optional => "optional", DependencyType::Optional => "optional",
DependencyType::Incompatible => "incompatible", DependencyType::Incompatible => "incompatible",
DependencyType::Embedded => "embedded",
} }
} }
@@ -468,6 +470,7 @@ impl DependencyType {
"required" => DependencyType::Required, "required" => DependencyType::Required,
"optional" => DependencyType::Optional, "optional" => DependencyType::Optional,
"incompatible" => DependencyType::Incompatible, "incompatible" => DependencyType::Incompatible,
"embedded" => DependencyType::Embedded,
_ => DependencyType::Required, _ => DependencyType::Required,
} }
} }

View File

@@ -734,7 +734,7 @@ pub async fn upload_file(
project_id: Some(models::ProjectId(project_id)), project_id: Some(models::ProjectId(project_id)),
version_id: Some(models::VersionId(version_id)), version_id: Some(models::VersionId(version_id)),
file_name: None, file_name: None,
dependency_type: DependencyType::Required dependency_type: DependencyType::Embedded
.to_string(), .to_string(),
}); });
} }
@@ -750,7 +750,7 @@ pub async fn upload_file(
.unwrap_or(first_download) .unwrap_or(first_download)
.to_string(), .to_string(),
), ),
dependency_type: DependencyType::Required.to_string(), dependency_type: DependencyType::Embedded.to_string(),
}); });
} }
} }
@@ -761,7 +761,7 @@ pub async fn upload_file(
project_id: None, project_id: None,
version_id: None, version_id: None,
file_name: Some(file.to_string()), file_name: Some(file.to_string()),
dependency_type: DependencyType::Required.to_string(), dependency_type: DependencyType::Embedded.to_string(),
}); });
} }
} }