Skip to content

Commit

Permalink
fix mac-arm and mac-intel not being valid filters
Browse files Browse the repository at this point in the history
  • Loading branch information
Fleeym committed Jun 9, 2024
1 parent 95f4696 commit 9bd0ea3
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
15 changes: 10 additions & 5 deletions src/types/models/mod_entity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -157,11 +157,16 @@ impl Mod {
let platform = VerPlatform::from_str(trimmed).or(Err(ApiError::BadRequest(
format!("Invalid platform {}", trimmed),
)))?;
if platform == VerPlatform::Android {
platforms.push(VerPlatform::Android32);
platforms.push(VerPlatform::Android64);
} else {
platforms.push(platform)
match platform {
VerPlatform::Android => {
platforms.push(VerPlatform::Android32);
platforms.push(VerPlatform::Android64);
},
VerPlatform::Mac => {
platforms.push(VerPlatform::MacArm);
platforms.push(VerPlatform::MacIntel);
},
_ => platforms.push(platform),
}
}
}
Expand Down
6 changes: 4 additions & 2 deletions src/types/models/mod_gd_version.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,11 @@ pub enum VerPlatform {
Ios,
#[sqlx(skip)]
Mac,
#[serde(rename = "mac-arm")]
#[sqlx(rename = "mac-arm")]
#[serde(rename = "mac-arm")]
MacArm,
#[serde(rename = "mac-intel")]
#[sqlx(rename = "mac-intel")]
#[serde(rename = "mac-intel")]
MacIntel,
Win,
}
Expand All @@ -75,6 +75,8 @@ impl FromStr for VerPlatform {
"android64" => Ok(VerPlatform::Android64),
"ios" => Ok(VerPlatform::Ios),
"mac" => Ok(VerPlatform::Mac),
"mac-arm" => Ok(VerPlatform::MacArm),
"mac-intel" => Ok(VerPlatform::MacIntel),
"win" => Ok(VerPlatform::Win),
"windows" => Ok(VerPlatform::Win),
"macos" => Ok(VerPlatform::Mac),
Expand Down

0 comments on commit 9bd0ea3

Please sign in to comment.