chore(chapter): No longer set last_update as newest chapter's

date_upload

Grab this info from SQL instead
This commit is contained in:
Ahmad Ansori Palembani 2024-12-18 11:29:55 +07:00
parent b3e69bdb28
commit 02296985d6
Signed by: null2264
GPG key ID: BA64F8B60AF3EFB6

View file

@ -118,12 +118,7 @@ suspend fun syncChaptersWithSource(
// Return if there's nothing to add, delete or change, avoid unnecessary db transactions.
if (toAdd.isEmpty() && toDelete.isEmpty() && toChange.isEmpty()) {
val newestDate = dbChapters.maxOfOrNull { it.date_upload } ?: 0L
if (newestDate != 0L && newestDate > manga.last_update) {
manga.last_update = newestDate
val update = MangaUpdate(manga.id!!, lastUpdate = newestDate)
updateManga.await(update)
}
// TODO: Predict when the next chapter gonna release
return Pair(emptyList(), emptyList())
}
@ -189,6 +184,8 @@ suspend fun syncChaptersWithSource(
}
}
// TODO: Predict when the next chapter gonna release
// Set this manga as updated since chapters were changed
// Note that last_update actually represents last time the chapter list changed at all
// Those changes already checked beforehand, so we can proceed to updating the manga