DistroqueryAPI: getRepositoryPackages: return more information for each package

This commit is contained in:
Silvan Calarco 2024-07-06 19:17:27 +02:00
parent e7e06284da
commit f320087f12

View File

@ -160,7 +160,13 @@ json DistroqueryAPI::getRepositoryPackages(string repository, int per_page, int
}
json package;
package["name"] = reinterpret_cast<const char*>(sqlite3_column_text(stmt,sqlite3_find_column_id(stmt, NULL, "name")));
package["version"] = reinterpret_cast<const char*>(sqlite3_column_text(stmt,sqlite3_find_column_id(stmt, NULL, "version")));
package["release"] = reinterpret_cast<const char*>(sqlite3_column_text(stmt,sqlite3_find_column_id(stmt, NULL, "release")));
package["summary"] = reinterpret_cast<const char*>(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);