From 3d9f1dbeba8630966cf67a94980c2619e56227a3 Mon Sep 17 00:00:00 2001 From: "David J. Allen" Date: Sun, 25 Jun 2023 20:08:15 -0600 Subject: [PATCH] Removed `max_results` from config (in rest_api) --- src/package_manager.cpp | 8 ++++---- src/rest_api.cpp | 7 +------ 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/src/package_manager.cpp b/src/package_manager.cpp index 25e3554..97c97a6 100644 --- a/src/package_manager.cpp +++ b/src/package_manager.cpp @@ -98,10 +98,10 @@ namespace gdpm::package_manager{ auto configOpt = option("--config-path").set(config.path) % "set config path"; auto pathOpt = option("--path").set(params.paths) % "specify a path to use with command"; auto typeOpt = option("--type").set(config.info.type) % "set package type (any|addon|project)"; - auto sortOpt = option("--sort").set(config.api_params.sort) % "sort packages in order (rating|cost|name|updated)"; - auto supportOpt = option("--support").set(config.api_params.support) % "set the support level for API (all|official|community|testing)"; - auto maxResultsOpt = option("--max-results").set(config.api_params.max_results) % "set the request max results"; - auto godotVersionOpt = option("--godot-version").set(config.api_params.godot_version) % "set the request Godot version"; + auto sortOpt = option("--sort").set(config.rest_api_params.sort) % "sort packages in order (rating|cost|name|updated)"; + auto supportOpt = option("--support").set(config.rest_api_params.support) % "set the support level for API (all|official|community|testing)"; + auto maxResultsOpt = option("--max-results").set(config.rest_api_params.max_results) % "set the request max results"; + auto godotVersionOpt = option("--godot-version").set(config.rest_api_params.godot_version) % "set the request Godot version"; auto packageDirOpt = option("--package-dir").set(config.packages_dir) % "set the global package location"; auto tmpDirOpt = option("--tmp-dir").set(config.tmp_dir) % "set the temporary download location"; auto timeoutOpt = option("--timeout").set(config.timeout) % "set the request timeout"; diff --git a/src/rest_api.cpp b/src/rest_api.cpp index 0dfdcb7..6e17b24 100644 --- a/src/rest_api.cpp +++ b/src/rest_api.cpp @@ -17,12 +17,7 @@ namespace gdpm::rest_api{ request_params make_from_config(const config::context& config){ - bool is_latest = (config.info.godot_version.empty() || config.info.godot_version == "latest"); - request_params params = make_request_params(); - params.godot_version = (is_latest) ? "" : config.info.godot_version; - params.verbose = config.verbose; - params.max_results = config.max_results; - return params; + return config.api_params; } request_params make_request_params(