Fix read history removal

This commit is contained in:
Jobobby04 2020-06-12 19:31:33 -04:00
parent e30694c12c
commit 4382deb943

View File

@ -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()
} }
/** /**