Update src/server.cpp
All checks were successful
Build-Test-Publish / build (linux/amd64) (push) Successful in 59s
Build-Test-Publish / build (linux/arm64) (push) Successful in 1m25s
Build-Test-Publish / create-manifest (push) Successful in 13s

This commit is contained in:
Your Name
2025-09-02 15:36:40 +12:00
parent a70dce2e75
commit 4857754618

View File

@@ -353,10 +353,13 @@ void Server::handle_get_directory(const drogon::HttpRequestPtr& /*req*/, std::fu
}
// output the labeltags as an array of label:tag pairs
// Filter out entries that have no labeltags
nlohmann::json entries_array = nlohmann::json::array();
for (const auto& entry : entries) {
if (!entry.labeltags.empty()) {
entries_array.push_back({{"labeltags", entry.labeltags}, {"hash", entry.hash}});
}
}
auto resp = drogon::HttpResponse::newHttpResponse();
nlohmann::json response = {{"result", "success"}, {"entries", entries_array}};