Fix EHentai reading progress not carrying over

This commit is contained in:
NerdNumber9
2019-08-13 00:04:02 -04:00
parent b64ecfb836
commit 141edac99b
4 changed files with 39 additions and 15 deletions

View File

@ -87,9 +87,7 @@ class EHentaiUpdateHelper(context: Context) {
.fold(accepted.chapters) { curChapters, chapter ->
val existing = curChapters.find { it.url == chapter.url }
val newLastPageRead = chainsAsChapters.filter { it.date_upload < chapter.date_upload }.maxBy {
it.last_page_read
}?.last_page_read
val newLastPageRead = chainsAsChapters.maxBy { it.last_page_read }?.last_page_read
if (existing != null) {
existing.read = existing.read || chapter.read