From aef2f84ed79cc65e580a27e194816c5746fc5172 Mon Sep 17 00:00:00 2001 From: Your Name Date: Sun, 25 May 2025 13:16:42 +1200 Subject: [PATCH] Bug fixing --- src/server.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/server.cpp b/src/server.cpp index 42ec655..ac2042d 100644 --- a/src/server.cpp +++ b/src/server.cpp @@ -259,12 +259,11 @@ void Server::handle_get_directory(const httplib::Request& /*req*/, httplib::Resp res.set_content(response.dump(), "application/json"); return; } - + + // output the labeltags as an array of label:tag pairs nlohmann::json entries_array = nlohmann::json::array(); for (const auto& entry : entries) { - for (const auto & labeltag : entry.labeltags) { - entries_array.push_back({{"labeltag", labeltag}, {"hash", entry.hash}}); - } + entries_array.push_back({{"labeltags", entry.labeltags}, {"hash", entry.hash}}); } nlohmann::json response = {{"result", "success"}, {"entries", entries_array}};