From f320087f124e437565dc69de4f43d2528fd75ca6 Mon Sep 17 00:00:00 2001 From: Silvan Calarco Date: Sat, 6 Jul 2024 19:17:27 +0200 Subject: [PATCH] DistroqueryAPI: getRepositoryPackages: return more information for each package --- src/DistroqueryAPI.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/DistroqueryAPI.cpp b/src/DistroqueryAPI.cpp index 37919b4..3109837 100644 --- a/src/DistroqueryAPI.cpp +++ b/src/DistroqueryAPI.cpp @@ -160,7 +160,13 @@ json DistroqueryAPI::getRepositoryPackages(string repository, int per_page, int } json package; package["name"] = reinterpret_cast(sqlite3_column_text(stmt,sqlite3_find_column_id(stmt, NULL, "name"))); + package["version"] = reinterpret_cast(sqlite3_column_text(stmt,sqlite3_find_column_id(stmt, NULL, "version"))); + package["release"] = reinterpret_cast(sqlite3_column_text(stmt,sqlite3_find_column_id(stmt, NULL, "release"))); package["summary"] = reinterpret_cast(sqlite3_column_text(stmt,sqlite3_find_column_id(stmt, NULL, "summary"))); + auto itt = (time_t)sqlite3_column_int(stmt,sqlite3_find_column_id(stmt, NULL, "buildtime")); + ostringstream ss; + ss << std::put_time(gmtime(&itt), "%FT%TZ"); + package["buildtime"] = ss.str(); packages.push_back(package); } sqlite3_finalize(stmt);