Skip to content

Commit

Permalink
update search api
Browse files Browse the repository at this point in the history
  • Loading branch information
kaniol-lck committed Jun 4, 2024
1 parent 2850591 commit 30be938
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 8 deletions.
3 changes: 2 additions & 1 deletion src/curseforge/curseforgeapi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ Reply<QList<CurseforgeModInfo> > CurseforgeAPI::searchMods(int sectionId, const
//mod
urlQuery.addQueryItem("classId", QString::number(sectionId));
//sort, 0 for no sort spec
urlQuery.addQueryItem("sortOrder", QString::number(sort + 1));
urlQuery.addQueryItem("sortField", QString::number(sort + 1));
urlQuery.addQueryItem("sortOrder", "desc");

url.setQuery(urlQuery);

Expand Down
8 changes: 4 additions & 4 deletions src/modrinth/modrinthapi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,13 @@ Reply<QList<ModrinthModInfo>> ModrinthAPI::searchMods(const QString name, int in
str = "downloads";
break;
case 2:
str = "follows";//New add
str = "follows";
break;
case 3:
str = "updated";
str = "newest";
break;
case 4:
str = "newest";
str = "updated";
break;
}
urlQuery.addQueryItem("index", str);
Expand All @@ -72,7 +72,7 @@ Reply<QList<ModrinthModInfo>> ModrinthAPI::searchMods(const QString name, int in
if(type != ModLoaderType::Any)
categoryFacets << "categories:" + ModLoaderType::toString(type);

//loader type
//category
for(const auto &category : categories)
if(!category.isEmpty())
categoryFacets << "categories:" + category;
Expand Down
27 changes: 26 additions & 1 deletion src/ui/curseforge/curseforgemodbrowser.ui
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,11 @@
<height>41</height>
</rect>
</property>
<item>
<property name="text">
<string>Featured</string>
</property>
</item>
<item>
<property name="text">
<string>Popularity</string>
Expand Down Expand Up @@ -103,6 +108,26 @@
<string>Game Version</string>
</property>
</item>
<item>
<property name="text">
<string>Early Access</string>
</property>
</item>
<item>
<property name="text">
<string>Featured Released</string>
</property>
</item>
<item>
<property name="text">
<string>Released Date</string>
</property>
</item>
<item>
<property name="text">
<string>Rating</string>
</property>
</item>
</widget>
</widget>
<widget class="MenuToolBar" name="toolBar">
Expand Down Expand Up @@ -139,7 +164,7 @@
<x>0</x>
<y>0</y>
<width>800</width>
<height>27</height>
<height>26</height>
</rect>
</property>
<widget class="QMenu" name="menu_Mod">
Expand Down
9 changes: 7 additions & 2 deletions src/ui/modrinth/modrinthmodbrowser.ui
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,19 @@
</item>
<item>
<property name="text">
<string>Updated</string>
<string>Follows</string>
</property>
</item>
<item>
<property name="text">
<string>Newest</string>
</property>
</item>
<item>
<property name="text">
<string>Updated</string>
</property>
</item>
</widget>
<widget class="QComboBox" name="loaderSelect">
<property name="geometry">
Expand All @@ -96,7 +101,7 @@
<x>0</x>
<y>0</y>
<width>800</width>
<height>27</height>
<height>26</height>
</rect>
</property>
<widget class="QMenu" name="menu_Mod">
Expand Down

0 comments on commit 30be938

Please sign in to comment.