Allow offline filtering #75
@ -66,16 +66,16 @@ class Repository(private val api: SelfossApi, private val appSettingsService: Ap
|
||||
} else {
|
||||
if (appSettingsService.isItemCachingEnabled()) {
|
||||
fromDB = true
|
||||
val dbItems = getDBItems().filter {
|
||||
var dbItems = getDBItems().filter {
|
||||
displayedItems == ItemType.ALL ||
|
||||
(it.unread && displayedItems == ItemType.UNREAD) ||
|
||||
|
||||
(it.starred && displayedItems == ItemType.STARRED)
|
||||
}
|
||||
if (tagFilter != null) {
|
||||
dbItems.filter { it.tags.contains(tagFilter!!.tag) }
|
||||
dbItems = dbItems.filter { it.tags.split(',').contains(tagFilter!!.tag) }
|
||||
AmineB
commented
This should be This should be `dbItems = dbItems.filter { it.tags.contains(tagFilter!!.tag) }` (with `dbItems` being a var). Else, it does not filter anything.
|
||||
}
|
||||
if (sourceFilter != null) {
|
||||
dbItems.filter { it.sourcetitle == sourceFilter!!.title }
|
||||
dbItems = dbItems.filter { it.sourcetitle == sourceFilter!!.title }
|
||||
AmineB
commented
This should be This should be `dbItems = dbItems.filter { it.tags.contains(tagFilter!!.tag) }` (with `dbItems` being a var). Else, it does not filter anything.
davidoskky
commented
Right... I didn't write the tests correctly and assumed that worked... Right... I didn't write the tests correctly and assumed that worked...
|
||||
}
|
||||
fetchedItems = SelfossModel.StatusAndData.succes(
|
||||
dbItems.map { it.toView() }
|
||||
|
Loading…
Reference in New Issue
Block a user
This should be something like this.