diff --git a/client/components/app/BookShelfToolbar.vue b/client/components/app/BookShelfToolbar.vue index d512bc1b..a3879279 100644 --- a/client/components/app/BookShelfToolbar.vue +++ b/client/components/app/BookShelfToolbar.vue @@ -163,6 +163,14 @@ export default { text: this.$strings.LabelAddedAt, value: 'addedAt' }, + { + text: this.$strings.LabelLastBookAdded, + value: 'lastBookAdded' + }, + { + text: this.$strings.LabelLastBookUpdated, + value: 'lastBookUpdated' + }, { text: this.$strings.LabelTotalDuration, value: 'totalDuration' diff --git a/client/strings/en-us.json b/client/strings/en-us.json index 1ea2fa27..5cbef6d3 100644 --- a/client/strings/en-us.json +++ b/client/strings/en-us.json @@ -250,6 +250,8 @@ "LabelItem": "Item", "LabelLanguage": "Language", "LabelLanguageDefaultServer": "Default Server Language", + "LabelLastBookAdded": "Last Book Added", + "LabelLastBookUpdated": "Last Book Updated", "LabelLastSeen": "Last Seen", "LabelLastTime": "Last Time", "LabelLastUpdate": "Last Update", diff --git a/server/controllers/LibraryController.js b/server/controllers/LibraryController.js index bbc70f31..154f6f17 100644 --- a/server/controllers/LibraryController.js +++ b/server/controllers/LibraryController.js @@ -417,6 +417,10 @@ class LibraryController { return se.totalDuration } else if (payload.sortBy === 'addedAt') { return se.addedAt + } else if (payload.sortBy === 'lastBookUpdated') { + return Math.max(...(se.books).map(x => x.updatedAt), 0) + } else if (payload.sortBy === 'lastBookAdded') { + return Math.max(...(se.books).map(x => x.addedAt), 0) } else { // sort by name return this.db.serverSettings.sortingIgnorePrefix ? se.nameIgnorePrefixSort : se.name }