mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-02-19 00:18:56 +01:00
Merge pull request #1670 from divyangbw/feat-new-sortBy-last-book
Add sortBy Last Book Added and Updated to series
This commit is contained in:
commit
55fdc48d5d
@ -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'
|
||||
|
@ -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 || [] : []
|
||||
|
@ -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",
|
||||
|
@ -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",
|
||||
|
@ -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",
|
||||
|
@ -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",
|
||||
|
@ -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"
|
||||
}
|
||||
}
|
@ -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",
|
||||
|
@ -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",
|
||||
|
@ -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",
|
||||
|
@ -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",
|
||||
|
@ -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": "Последний обновленный",
|
||||
|
@ -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": "最近更新",
|
||||
|
@ -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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user