Hidden categories are not showed in suggested categories (#3853)

This commit is contained in:
Paulina 2020-07-19 10:29:29 -05:00 committed by GitHub
parent 8630ba8025
commit 67beb947c5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 20 additions and 3 deletions

View file

@ -92,8 +92,9 @@ class CategoryClient @Inject constructor(private val categoryInterface: Category
it.query()?.pages() ?: emptyList()
}
.map {
it.map { page -> page.title().replace(CATEGORY_PREFIX, "") }
it.filter {
page -> page.categoryInfo() == null || !page.categoryInfo().isHidden
}.map { page -> page.title().replace(CATEGORY_PREFIX, "") }
}
}
}

View file

@ -32,7 +32,7 @@ public interface CategoryInterface {
* @return
*/
@GET("w/api.php?action=query&format=json&formatversion=2"
+ "&generator=allcategories")
+ "&generator=allcategories&prop=categoryinfo")
Single<MwQueryResponse> searchCategoriesForPrefix(@Query("gacprefix") String prefix,
@Query("gaclimit") int itemLimit, @Query("gacoffset") int offset);