aboutsummaryrefslogtreecommitdiff
path: root/launcher/modplatform/modrinth/ModrinthAPI.h
diff options
context:
space:
mode:
authorflow <thiagodonato300@gmail.com>2022-04-02 19:21:02 -0300
committerflow <thiagodonato300@gmail.com>2022-04-15 08:49:41 -0300
commit5cb0e750936f09513b98a8b0fd57746ca18dc8bc (patch)
tree97f044a7a899cc0ecb2189af95b86132ba71031f /launcher/modplatform/modrinth/ModrinthAPI.h
parentc730fd6e5f125cde324d110282ed33ea4b9df136 (diff)
downloadPrismLauncher-5cb0e750936f09513b98a8b0fd57746ca18dc8bc.tar.gz
PrismLauncher-5cb0e750936f09513b98a8b0fd57746ca18dc8bc.tar.bz2
PrismLauncher-5cb0e750936f09513b98a8b0fd57746ca18dc8bc.zip
fix(ui): Refresh mod list when changing filtering options
Diffstat (limited to 'launcher/modplatform/modrinth/ModrinthAPI.h')
-rw-r--r--launcher/modplatform/modrinth/ModrinthAPI.h14
1 files changed, 12 insertions, 2 deletions
diff --git a/launcher/modplatform/modrinth/ModrinthAPI.h b/launcher/modplatform/modrinth/ModrinthAPI.h
index 0d652568..87534ee9 100644
--- a/launcher/modplatform/modrinth/ModrinthAPI.h
+++ b/launcher/modplatform/modrinth/ModrinthAPI.h
@@ -22,12 +22,12 @@ class ModrinthAPI : public NetworkModAPI {
"limit=25&"
"query=%2&"
"index=%3&"
- "facets=[[\"categories:%4\"],[\"versions:%5\"],[\"project_type:mod\"]]")
+ "facets=[[\"categories:%4\"],[%5],[\"project_type:mod\"]]")
.arg(args.offset)
.arg(args.search)
.arg(args.sorting)
.arg(getModLoaderString(args.mod_loader))
- .arg(getGameVersionsString(args.versions));
+ .arg(getGameVersionsArray(args.versions));
};
inline auto getVersionsURL(VersionSearchArgs& args) const -> QString override
@@ -40,6 +40,16 @@ class ModrinthAPI : public NetworkModAPI {
.arg(getModLoaderString(args.loader));
};
+ auto getGameVersionsArray(std::list<Version> mcVersions) const -> QString
+ {
+ QString s;
+ for(auto& ver : mcVersions){
+ s += QString("\"versions:%1\",").arg(ver.toString());
+ }
+ s.remove(s.length() - 1, 1); //remove last comma
+ return s;
+ }
+
static auto getModLoaderString(ModLoaderType type) -> const QString
{
if (type == Unspecified)