Fetch up to 100 results... and fix the layout when filtering

This commit is contained in:
downthecrop 2025-09-18 22:56:39 -07:00
parent 5dd299ecdd
commit 3fae644550
2 changed files with 23 additions and 22 deletions

View file

@ -29,7 +29,7 @@ object GitLabPluginFetcher {
try {
debugLog("Starting to fetch GitLab plugins...")
val plugins = mutableListOf<GitLabPlugin>()
val apiUrl = "https://gitlab.com/api/v4/projects/${GITLAB_PROJECT_ID}/repository/tree?ref=${GITLAB_BRANCH}"
val apiUrl = "https://gitlab.com/api/v4/projects/${GITLAB_PROJECT_ID}/repository/tree?ref=${GITLAB_BRANCH}&per_page=100"
debugLog("API URL: $apiUrl")
// Create URL connection
@ -54,10 +54,10 @@ object GitLabPluginFetcher {
val treeItems = gson.fromJson(response, Array<JsonObject>::class.java)
debugLog("Parsed ${treeItems.size} items from JSON")
// Filter for directories (trees)
// Filter for directories (trees) with mode "040000"
var directoryCount = 0
for (jsonObject in treeItems) {
if (jsonObject["type"].asString == "tree") {
if (jsonObject["type"].asString == "tree" && jsonObject["mode"].asString == "040000") {
directoryCount++
val folderId = jsonObject["id"].asString
val folderPath = jsonObject["path"].asString