(cherry picked from commit 4084d5e69a2b19470fc32860b9b7c2722841a0f2)
This commit is contained in:
parent
0f7e251306
commit
c89f88de16
@ -13,8 +13,10 @@ interface Manga : SManga {
|
|||||||
|
|
||||||
var favorite: Boolean
|
var favorite: Boolean
|
||||||
|
|
||||||
|
// last time the chapter list changed in any way
|
||||||
var last_update: Long
|
var last_update: Long
|
||||||
|
|
||||||
|
// predicted next update time based on latest (by date) 4 chapters' deltas
|
||||||
var next_update: Long
|
var next_update: Long
|
||||||
|
|
||||||
var date_added: Long
|
var date_added: Long
|
||||||
|
@ -112,10 +112,6 @@ fun syncChaptersWithSource(
|
|||||||
db.updateNextUpdated(manga).executeAsBlocking()
|
db.updateNextUpdated(manga).executeAsBlocking()
|
||||||
}
|
}
|
||||||
|
|
||||||
if (newestDate != 0L && newestDate != manga.last_update) {
|
|
||||||
manga.last_update = newestDate
|
|
||||||
db.updateLastUpdated(manga).executeAsBlocking()
|
|
||||||
}
|
|
||||||
return Pair(emptyList(), emptyList())
|
return Pair(emptyList(), emptyList())
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -193,13 +189,8 @@ fun syncChaptersWithSource(
|
|||||||
db.fixChaptersSourceOrder(sourceChapters).executeAsBlocking()
|
db.fixChaptersSourceOrder(sourceChapters).executeAsBlocking()
|
||||||
|
|
||||||
// Set this manga as updated since chapters were changed
|
// Set this manga as updated since chapters were changed
|
||||||
val newestChapter = topChapters.getOrNull(0)
|
// Note that last_update actually represents last time the chapter list changed at all
|
||||||
val dateFetch = newestChapter?.date_upload ?: manga.last_update
|
manga.last_update = Date().time
|
||||||
if (dateFetch == 0L) {
|
|
||||||
if (toAdd.isNotEmpty()) {
|
|
||||||
manga.last_update = Date().time
|
|
||||||
}
|
|
||||||
} else manga.last_update = dateFetch
|
|
||||||
db.updateLastUpdated(manga).executeAsBlocking()
|
db.updateLastUpdated(manga).executeAsBlocking()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user