From 9e49b6fa20a498602431cad9151c41ef5e2c38e1 Mon Sep 17 00:00:00 2001 From: Sude Date: Tue, 14 Mar 2023 09:57:10 +0200 Subject: [PATCH] Always use array value when listing game details in JSON format --- src/downloader.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/downloader.cpp b/src/downloader.cpp index f6e0117..3a5f6e1 100644 --- a/src/downloader.cpp +++ b/src/downloader.cpp @@ -554,8 +554,11 @@ int Downloader::listGames() if (Globals::globalConfig.iListFormat == GlobalConstants::LIST_FORMAT_DETAILS_JSON) { + Json::Value json(Json::arrayValue); for (auto game : this->games) - std::cout << game.getDetailsAsJson() << std::endl; + json.append(game.getDetailsAsJson()); + + std::cout << json << std::endl; } else if (Globals::globalConfig.iListFormat == GlobalConstants::LIST_FORMAT_DETAILS_TEXT) {