Fix read history removal
This commit is contained in:
parent
e30694c12c
commit
4382deb943
@ -103,8 +103,8 @@ class HistoryPresenter : BasePresenter<HistoryController>() {
|
|||||||
*/
|
*/
|
||||||
fun removeFromHistory(history: History) {
|
fun removeFromHistory(history: History) {
|
||||||
history.last_read = 0L
|
history.last_read = 0L
|
||||||
db.updateHistoryLastRead(history).asRxObservable()
|
db.updateHistoryLastRead(history).executeAsBlocking()
|
||||||
.subscribe()
|
updateList()
|
||||||
}
|
}
|
||||||
|
|
||||||
fun updateList(search: String? = null) {
|
fun updateList(search: String? = null) {
|
||||||
@ -123,12 +123,10 @@ class HistoryPresenter : BasePresenter<HistoryController>() {
|
|||||||
* @param mangaId id of manga
|
* @param mangaId id of manga
|
||||||
*/
|
*/
|
||||||
fun removeAllFromHistory(mangaId: Long) {
|
fun removeAllFromHistory(mangaId: Long) {
|
||||||
db.getHistoryByMangaId(mangaId).asRxSingle()
|
val history = db.getHistoryByMangaId(mangaId).executeAsBlocking()
|
||||||
.map { list ->
|
history.forEach { it.last_read = 0L }
|
||||||
list.forEach { it.last_read = 0L }
|
db.updateHistoryLastRead(history).executeAsBlocking()
|
||||||
db.updateHistoryLastRead(list).executeAsBlocking()
|
updateList()
|
||||||
}
|
|
||||||
.subscribe()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user