Fixed last updated logic

This commit is contained in:
Jay 2020-01-10 23:47:02 -08:00
parent 3ae6a4d33e
commit 3c81f60041

View File

@ -135,8 +135,8 @@ fun syncChaptersWithSource(db: DatabaseHelper,
// Set this manga as updated since chapters were changed
val newestChaper = db.getChapters(manga).executeAsBlocking().maxBy { it.date_fetch }
val dateFetch = newestChaper?.date_fetch ?: Date().time
manga.last_update = if (dateFetch == 0L) Date().time else dateFetch
val dateFetch = newestChaper?.date_fetch ?: manga.last_update
manga.last_update = dateFetch
db.updateLastUpdated(manga).executeAsBlocking()
}