Library View: Add latest chapter sorting and revert last updated sorting changes

Latest chapter is as it sounds
Last update is now any changes to the chapter list (addition, removal, rename, etc.)
This commit is contained in:
FlaminSarge
2020-01-27 02:54:48 -08:00
parent 3c41a5e910
commit a096e6b337
6 changed files with 41 additions and 6 deletions
@@ -129,9 +129,8 @@ fun syncChaptersWithSource(db: DatabaseHelper,
// Fix order in source.
db.fixChaptersSourceOrder(sourceChapters).executeAsBlocking()
// Set manga's last update time to latest chapter's upload time if possible
val newestChapter = db.getChapters(manga).executeAsBlocking().maxBy { it.date_upload }
manga.last_update = newestChapter?.date_upload ?: manga.last_update
// Set this manga as updated since chapters were changed
manga.last_update = Date().time
db.updateLastUpdated(manga).executeAsBlocking()
}