Fedora : do not include fork projects in the list

This commit is contained in:
Thomas Rubini 2022-12-14 15:13:14 +01:00
parent 6bd7090a4f
commit e986997662
No known key found for this signature in database
GPG Key ID: C7D287C8C1CAC373

View File

@ -93,15 +93,24 @@ public class FedoraDistribution extends AsyncRequestsParser implements Distribut
for (Object searchResultObj : json.getJSONArray("projects")) {
// convert object into String
JSONObject searchResultJson = (JSONObject) searchResultObj;
// get infos
String name = searchResultJson.getString("name");
// do not include fork projects in the list
if(!name.startsWith("fork/")){
// add package into to list
searchedPackagesList.add(new SearchedPackage(
searchResultJson.getString("name"),
name,
null,
null,
searchResultJson.getString("description"),
"fedora"
));
}
}
futureSearchedPackages.complete(searchedPackagesList);
}).exceptionally(error->{
error.printStackTrace();