Skip to content

Commit

Permalink
check for exact category match on upload search (#5328)
Browse files Browse the repository at this point in the history
  • Loading branch information
Deanstirrat authored Oct 7, 2023
1 parent 048b78a commit 05fbfce
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ class CategoriesPresenter @Inject constructor(
if (media == null) {
return repository.searchAll(term, getImageTitleList(), repository.selectedDepictions)
.subscribeOn(ioScheduler)
.map { it.filterNot { categoryItem -> repository.containsYear(categoryItem.name) } }
.map { it.filter { categoryItem -> !repository.containsYear(categoryItem.name)
|| categoryItem.name==term } }
} else {
return Observable.zip(
repository.getCategories(repository.selectedExistingCategories)
Expand All @@ -97,7 +98,8 @@ class CategoriesPresenter @Inject constructor(
}
)
.subscribeOn(ioScheduler)
.map { it.filterNot { categoryItem -> repository.containsYear(categoryItem.name) } }
.map { it.filter { categoryItem -> !repository.containsYear(categoryItem.name)
|| categoryItem.name==term } }
.map { it.filterNot { categoryItem -> categoryItem.thumbnail == "hidden" } }
}
}
Expand Down

0 comments on commit 05fbfce

Please sign in to comment.