Skip to content

Commit

Permalink
Consider only packages with type generic
Browse files Browse the repository at this point in the history
  • Loading branch information
Morian Sonnet committed Sep 10, 2023
1 parent 46af88f commit 1c51996
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/providers/gitlab.rs
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,11 @@ impl super::PackageProvider for Gitlab {
}
}

let res: Vec<GitlabPackageResponse> = res.json().await?;
let res: Vec<GitlabPackageResponse> = res.json::<Vec<GitlabPackageResponse>>()
.await?
.into_iter()
.filter(|release| release.package_type == "generic")
.collect();

for release in res {
let this = Arc::clone(&self);
Expand Down Expand Up @@ -358,6 +362,7 @@ pub struct GitlabPackageResponse {
pub id: u64,
pub name: String,
pub version: String,
pub package_type: String,
#[serde(rename = "_links")]
pub links: GitlabPackageLinksResponse,
}
Expand Down

0 comments on commit 1c51996

Please sign in to comment.