Actually filter database items
All checks were successful
continuous-integration/drone/pr Build is passing
All checks were successful
continuous-integration/drone/pr Build is passing
This commit is contained in:
parent
208babbce3
commit
8bfe14c019
@ -66,16 +66,16 @@ class Repository(private val api: SelfossApi, private val appSettingsService: Ap
|
|||||||
} else {
|
} else {
|
||||||
if (appSettingsService.isItemCachingEnabled()) {
|
if (appSettingsService.isItemCachingEnabled()) {
|
||||||
fromDB = true
|
fromDB = true
|
||||||
val dbItems = getDBItems().filter {
|
var dbItems = getDBItems().filter {
|
||||||
displayedItems == ItemType.ALL ||
|
displayedItems == ItemType.ALL ||
|
||||||
(it.unread && displayedItems == ItemType.UNREAD) ||
|
(it.unread && displayedItems == ItemType.UNREAD) ||
|
||||||
(it.starred && displayedItems == ItemType.STARRED)
|
(it.starred && displayedItems == ItemType.STARRED)
|
||||||
}
|
}
|
||||||
if (tagFilter != null) {
|
if (tagFilter != null) {
|
||||||
dbItems.filter { it.tags.contains(tagFilter!!.tag) }
|
dbItems = dbItems.filter { it.tags.split(',').contains(tagFilter!!.tag) }
|
||||||
}
|
}
|
||||||
if (sourceFilter != null) {
|
if (sourceFilter != null) {
|
||||||
dbItems.filter { it.sourcetitle == sourceFilter!!.title }
|
dbItems = dbItems.filter { it.sourcetitle == sourceFilter!!.title }
|
||||||
}
|
}
|
||||||
fetchedItems = SelfossModel.StatusAndData.succes(
|
fetchedItems = SelfossModel.StatusAndData.succes(
|
||||||
dbItems.map { it.toView() }
|
dbItems.map { it.toView() }
|
||||||
|
Loading…
Reference in New Issue
Block a user