Skip to content

Commit

Permalink
Fixed issue where MinecraftWrapper uses the wrong parameters on the S…
Browse files Browse the repository at this point in the history
…earchParam
  • Loading branch information
OwenCochell committed Aug 29, 2022
1 parent 269eed8 commit d808d77
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
12 changes: 6 additions & 6 deletions cursepy/wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ def get_minecraft(self) -> base.CurseGame:
def sub_category(self, category_id: int) -> Tuple[base.CurseCategory, ...]:
"""
Returns all sub-catagories for the given category.
We automatically pass the game ID when called,
so the user can fetch sub-categories without passing a game ID.
This allows us to operate like the BaseClient method for getting sub-categories.
Expand Down Expand Up @@ -398,7 +398,7 @@ def search_resource_packs(self, search: SearchParam=None) -> Tuple[base.CurseAdd

search = self.get_search()

search.categoryId = MinecraftWrapper.RESOURCE_PACKS
search.rootCategoryId = MinecraftWrapper.RESOURCE_PACKS

return self.search(MinecraftWrapper.GAME_ID, search)

Expand All @@ -419,7 +419,7 @@ def search_modpacks(self, search: SearchParam=None) -> Tuple[base.CurseAddon, ..

search = self.get_search()

search.categoryId = MinecraftWrapper.MODPACKS
search.rootCategoryId = MinecraftWrapper.MODPACKS

return self.search(MinecraftWrapper.GAME_ID, search)

Expand All @@ -440,7 +440,7 @@ def search_mods(self, search: SearchParam=None) -> Tuple[base.CurseAddon, ...]:

search = self.get_search()

search.categoryId = MinecraftWrapper.MODS
search.rootCategoryId = MinecraftWrapper.MODS

return self.search(MinecraftWrapper.GAME_ID, search)

Expand All @@ -461,7 +461,7 @@ def search_worlds(self, search: SearchParam=None) -> Tuple[base.CurseAddon, ...]

search = self.get_search()

search.categoryId = MinecraftWrapper.WORLDS
search.rootCategoryId = MinecraftWrapper.WORLDS

return self.search(MinecraftWrapper.GAME_ID, search)

Expand All @@ -482,6 +482,6 @@ def search_plugins(self, search: SearchParam=None) -> Tuple[base.CurseAddon]:

search = self.get_search()

search.categoryId = MinecraftWrapper.BUKKIT
search.rootCategoryId = MinecraftWrapper.BUKKIT

return self.search(MinecraftWrapper.GAME_ID, search)
1 change: 1 addition & 0 deletions docs/source/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ Bug Fixes
---------

* Fixed an issue with the MinecraftWrapper passing a category ID to the search() and iter_search() methods.
* MinecraftWrapper now uses 'rootCategoryId' instead of 'categoryId' on the SearchParam when searching

2.0.0
=====
Expand Down

0 comments on commit d808d77

Please sign in to comment.