Filter items from database according to tag and source

This commit is contained in:
davidoskky 2022-10-08 17:15:22 +02:00
parent fe12819163
commit 1d1c121aab

View File

@ -71,6 +71,10 @@ class Repository(private val api: SelfossApi, private val appSettingsService: Ap
displayedItems == ItemType.ALL ||
(it.unread && displayedItems == ItemType.UNREAD) ||
(it.starred && displayedItems == ItemType.STARRED)
}.filter {
tagFilter == null || it.tags.contains(tagFilter!!.tag)
}.filter {
sourceFilter == null || it.sourcetitle == sourceFilter!!.title
}.map { it.toView() }
)
}