Library View: Add latest chapter sorting and revert last updated sorting changes (#2563)

* 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.)

* Change latest chapter sort string to "Latest chapter" instead of "Last chapter"
This commit is contained in:
arkon
2020-02-11 18:41:31 -05:00
committed by GitHub
7 changed files with 42 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()
}