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/components/cards/LazySeriesCard.vue b/client/components/cards/LazySeriesCard.vue index db5e3ec5..313530b6 100644 --- a/client/components/cards/LazySeriesCard.vue +++ b/client/components/cards/LazySeriesCard.vue @@ -81,13 +81,20 @@ export default { return this.title }, displaySortLine() { - if (this.orderBy === 'addedAt') { - // return this.addedAt - return 'Added ' + this.$formatDate(this.addedAt, this.dateFormat) - } else if (this.orderBy === 'totalDuration') { - return 'Duration: ' + this.$elapsedPrettyExtended(this.totalDuration, false) + switch (this.orderBy) { + case 'addedAt': + return `${this.$strings.LabelAdded} ${this.$formatDate(this.addedAt, this.dateFormat)}` + case 'totalDuration': + return `${this.$strings.LabelDuration} ${this.$elapsedPrettyExtended(this.totalDuration, false)}` + case 'lastBookUpdated': + const lastUpdated = Math.max(...(this.books).map(x => x.updatedAt), 0) + return `${this.$strings.LabelLastBookUpdated} ${this.$formatDate(lastUpdated, this.dateFormat)}` + case 'lastBookAdded': + const lastBookAdded = Math.max(...(this.books).map(x => x.addedAt), 0) + return `${this.$strings.LabelLastBookAdded} ${this.$formatDate(lastBookAdded, this.dateFormat)}` + default: + return null } - return null }, books() { return this.series ? this.series.books || [] : [] diff --git a/client/strings/de.json b/client/strings/de.json index 4cac3511..5f09a73d 100644 --- a/client/strings/de.json +++ b/client/strings/de.json @@ -161,6 +161,7 @@ "LabelAccountTypeGuest": "Gast", "LabelAccountTypeUser": "Benutzer", "LabelActivity": "Aktivitäten", + "LabelAdded": "Added", "LabelAddedAt": "Hinzugefügt am", "LabelAddToCollection": "Zur Sammlung hinzufügen", "LabelAddToCollectionBatch": "Füge {0} Hörbüch(er)/Podcast(s) der Sammlung hinzu", @@ -250,6 +251,8 @@ "LabelItem": "Medium", "LabelLanguage": "Sprache", "LabelLanguageDefaultServer": "Standard-Server-Sprache", + "LabelLastBookAdded": "Last Book Added", + "LabelLastBookUpdated": "Last Book Updated", "LabelLastSeen": "Zuletzt angesehen", "LabelLastTime": "Letztes Mal", "LabelLastUpdate": "Letzte Aktualisierung", diff --git a/client/strings/en-us.json b/client/strings/en-us.json index 1ea2fa27..029c0422 100644 --- a/client/strings/en-us.json +++ b/client/strings/en-us.json @@ -161,6 +161,7 @@ "LabelAccountTypeGuest": "Guest", "LabelAccountTypeUser": "User", "LabelActivity": "Activity", + "LabelAdded": "Added", "LabelAddedAt": "Added At", "LabelAddToCollection": "Add to Collection", "LabelAddToCollectionBatch": "Add {0} Books to Collection", @@ -250,6 +251,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/client/strings/es.json b/client/strings/es.json index 17c13698..b74d8f27 100644 --- a/client/strings/es.json +++ b/client/strings/es.json @@ -161,6 +161,7 @@ "LabelAccountTypeGuest": "Invitado", "LabelAccountTypeUser": "Usuario", "LabelActivity": "Actividad", + "LabelAdded": "Added", "LabelAddedAt": "Añadido", "LabelAddToCollection": "Añadido a la Colección", "LabelAddToCollectionBatch": "Se Añadieron {0} Libros a la Colección", @@ -250,6 +251,8 @@ "LabelItem": "Elemento", "LabelLanguage": "Lenguaje", "LabelLanguageDefaultServer": "Lenguaje Predeterminado del Servidor", + "LabelLastBookAdded": "Last Book Added", + "LabelLastBookUpdated": "Last Book Updated", "LabelLastSeen": "Ultima Vez Visto", "LabelLastTime": "Ultima Vez", "LabelLastUpdate": "Ultima Actualización", diff --git a/client/strings/fr.json b/client/strings/fr.json index 98e527f6..397b5958 100644 --- a/client/strings/fr.json +++ b/client/strings/fr.json @@ -161,6 +161,7 @@ "LabelAccountTypeGuest": "Invité", "LabelAccountTypeUser": "Utilisateur", "LabelActivity": "Activité", + "LabelAdded": "Added", "LabelAddedAt": "Date d’ajout", "LabelAddToCollection": "Ajouter à la collection", "LabelAddToCollectionBatch": "Ajout de {0} livres à la lollection", @@ -250,6 +251,8 @@ "LabelItem": "Article", "LabelLanguage": "Langue", "LabelLanguageDefaultServer": "Langue par défaut", + "LabelLastBookAdded": "Last Book Added", + "LabelLastBookUpdated": "Last Book Updated", "LabelLastSeen": "Vu dernièrement", "LabelLastTime": "Progression", "LabelLastUpdate": "Dernière mise à jour", diff --git a/client/strings/gu.json b/client/strings/gu.json index ebc3d2df..ca8be820 100644 --- a/client/strings/gu.json +++ b/client/strings/gu.json @@ -161,6 +161,7 @@ "LabelAccountTypeGuest": "Guest", "LabelAccountTypeUser": "User", "LabelActivity": "Activity", + "LabelAdded": "Added", "LabelAddedAt": "Added At", "LabelAddToCollection": "Add to Collection", "LabelAddToCollectionBatch": "Add {0} Books to Collection", @@ -250,6 +251,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", @@ -639,4 +642,4 @@ "ToastSocketFailedToConnect": "Socket failed to connect", "ToastUserDeleteFailed": "Failed to delete user", "ToastUserDeleteSuccess": "User deleted" -} +} \ No newline at end of file diff --git a/client/strings/hi.json b/client/strings/hi.json index d1dcd1d7..29092ed7 100644 --- a/client/strings/hi.json +++ b/client/strings/hi.json @@ -161,6 +161,7 @@ "LabelAccountTypeGuest": "Guest", "LabelAccountTypeUser": "User", "LabelActivity": "Activity", + "LabelAdded": "Added", "LabelAddedAt": "Added At", "LabelAddToCollection": "Add to Collection", "LabelAddToCollectionBatch": "Add {0} Books to Collection", @@ -250,6 +251,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/client/strings/hr.json b/client/strings/hr.json index 69dcef74..97c740ba 100644 --- a/client/strings/hr.json +++ b/client/strings/hr.json @@ -161,6 +161,7 @@ "LabelAccountTypeGuest": "Gost", "LabelAccountTypeUser": "Korisnik", "LabelActivity": "Aktivnost", + "LabelAdded": "Added", "LabelAddedAt": "Added At", "LabelAddToCollection": "Dodaj u kolekciju", "LabelAddToCollectionBatch": "Add {0} Books to Collection", @@ -250,6 +251,8 @@ "LabelItem": "Stavka", "LabelLanguage": "Jezik", "LabelLanguageDefaultServer": "Default jezik servera", + "LabelLastBookAdded": "Last Book Added", + "LabelLastBookUpdated": "Last Book Updated", "LabelLastSeen": "Zadnje pogledano", "LabelLastTime": "Prošli put", "LabelLastUpdate": "Zadnja aktualizacija", diff --git a/client/strings/it.json b/client/strings/it.json index 1eecc3fc..b81ca9e5 100644 --- a/client/strings/it.json +++ b/client/strings/it.json @@ -161,6 +161,7 @@ "LabelAccountTypeGuest": "Ospite", "LabelAccountTypeUser": "Utente", "LabelActivity": "Attività", + "LabelAdded": "Added", "LabelAddedAt": "Aggiunto il", "LabelAddToCollection": "Aggiungi alla Raccolta", "LabelAddToCollectionBatch": "Aggiungi {0} Libri alla Raccolta", @@ -250,6 +251,8 @@ "LabelItem": "Oggetti", "LabelLanguage": "Lingua", "LabelLanguageDefaultServer": "Lingua di Default", + "LabelLastBookAdded": "Last Book Added", + "LabelLastBookUpdated": "Last Book Updated", "LabelLastSeen": "Ultimi Visti", "LabelLastTime": "Ultima Volta", "LabelLastUpdate": "Ultimo Aggiornamento", diff --git a/client/strings/pl.json b/client/strings/pl.json index ed0ba345..12402df4 100644 --- a/client/strings/pl.json +++ b/client/strings/pl.json @@ -161,6 +161,7 @@ "LabelAccountTypeGuest": "Gość", "LabelAccountTypeUser": "Użytkownik", "LabelActivity": "Aktywność", + "LabelAdded": "Added", "LabelAddedAt": "Dodano", "LabelAddToCollection": "Dodaj do kolekcji", "LabelAddToCollectionBatch": "Dodaj {0} książki do kolekcji", @@ -250,6 +251,8 @@ "LabelItem": "Pozycja", "LabelLanguage": "Język", "LabelLanguageDefaultServer": "Domyślny język serwera", + "LabelLastBookAdded": "Last Book Added", + "LabelLastBookUpdated": "Last Book Updated", "LabelLastSeen": "Ostatnio widziany", "LabelLastTime": "Ostatni czas", "LabelLastUpdate": "Ostatnia aktualizacja", diff --git a/client/strings/ru.json b/client/strings/ru.json index 1227d516..45c64498 100644 --- a/client/strings/ru.json +++ b/client/strings/ru.json @@ -161,6 +161,7 @@ "LabelAccountTypeGuest": "Гость", "LabelAccountTypeUser": "Пользователь", "LabelActivity": "Активность", + "LabelAdded": "Added", "LabelAddedAt": "Дата добавления", "LabelAddToCollection": "Добавить в коллекцию", "LabelAddToCollectionBatch": "Добавить {0} книг в коллекцию", @@ -250,6 +251,8 @@ "LabelItem": "Элемент", "LabelLanguage": "Язык", "LabelLanguageDefaultServer": "Язык сервера по умолчанию", + "LabelLastBookAdded": "Last Book Added", + "LabelLastBookUpdated": "Last Book Updated", "LabelLastSeen": "Последнее сканирование", "LabelLastTime": "Последний по времени", "LabelLastUpdate": "Последний обновленный", diff --git a/client/strings/zh-cn.json b/client/strings/zh-cn.json index 3a9b0c9c..bf84b937 100644 --- a/client/strings/zh-cn.json +++ b/client/strings/zh-cn.json @@ -161,6 +161,7 @@ "LabelAccountTypeGuest": "来宾", "LabelAccountTypeUser": "用户", "LabelActivity": "活动", + "LabelAdded": "Added", "LabelAddedAt": "添加于", "LabelAddToCollection": "添加到收藏", "LabelAddToCollectionBatch": "批量添加 {0} 个媒体到收藏", @@ -250,6 +251,8 @@ "LabelItem": "项目", "LabelLanguage": "语言", "LabelLanguageDefaultServer": "默认服务器语言", + "LabelLastBookAdded": "Last Book Added", + "LabelLastBookUpdated": "Last Book Updated", "LabelLastSeen": "上次查看时间", "LabelLastTime": "最近一次", "LabelLastUpdate": "最近更新", 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 }