diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryController.kt
index 3e0eeb69b8..6faed9ff6b 100644
--- a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryController.kt
+++ b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryController.kt
@@ -224,6 +224,7 @@ class LibraryController(
'c' -> subMenu.findItem(R.id.action_update_asc)?.isChecked = true
'd' -> subMenu.findItem(R.id.action_update_dsc)?.isChecked = true
'e' -> subMenu.findItem(R.id.action_unread)?.isChecked = true
+ 'f' -> subMenu.findItem(R.id.action_last_read)?.isChecked = true
}
}
else {
@@ -483,6 +484,7 @@ class LibraryController(
R.id.action_update_asc -> reOrder(3)
R.id.action_update_dsc -> reOrder(4)
R.id.action_unread -> reOrder(5)
+ R.id.action_last_read -> reOrder(6)
else -> return super.onOptionsItemSelected(item)
}
diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryPresenter.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryPresenter.kt
index c078a6101f..7eb1202f25 100644
--- a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryPresenter.kt
+++ b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryPresenter.kt
@@ -242,6 +242,11 @@ class LibraryPresenter(
'c' -> i2.manga.last_update.compareTo(i1.manga.last_update)
'd' -> i1.manga.last_update.compareTo(i2.manga.last_update)
'e' -> i2.manga.unread.compareTo(i1.manga.unread)
+ 'f' -> {
+ val manga1LastRead = lastReadManga[i1.manga.id!!] ?: lastReadManga.size
+ val manga2LastRead = lastReadManga[i2.manga.id!!] ?: lastReadManga.size
+ manga1LastRead.compareTo(manga2LastRead)
+ }
else -> sortAlphabetical(i1, i2)
}
}
diff --git a/app/src/main/res/menu/library.xml b/app/src/main/res/menu/library.xml
index c6eb308af7..8de98f1797 100644
--- a/app/src/main/res/menu/library.xml
+++ b/app/src/main/res/menu/library.xml
@@ -54,6 +54,9 @@
+