feat: sort series by books count

closes #459
This commit is contained in:
Gauthier Roebroeck 2021-03-15 10:57:33 +08:00
parent 3b95629126
commit b51e4917e1
3 changed files with 5 additions and 1 deletions

View file

@ -462,6 +462,7 @@
"role_user": "User"
},
"sort": {
"books_count": "Books count",
"date_added": "Date added",
"date_updated": "Date updated",
"file_name": "Filename",

View file

@ -226,6 +226,7 @@ export default Vue.extend({
{name: this.$t('sort.date_added').toString(), key: 'createdDate'},
{name: this.$t('sort.date_updated').toString(), key: 'lastModifiedDate'},
{name: this.$t('sort.folder_name').toString(), key: 'name'},
{name: this.$t('sort.books_count').toString(), key: 'booksCount'},
] as SortOption[]
},
filterOptionsList(): FiltersOptions {

View file

@ -19,6 +19,7 @@ import org.jooq.Record
import org.jooq.ResultQuery
import org.jooq.SelectOnConditionStep
import org.jooq.impl.DSL
import org.jooq.impl.DSL.field
import org.jooq.impl.DSL.inline
import org.jooq.impl.DSL.lower
import org.springframework.data.domain.Page
@ -69,7 +70,8 @@ class SeriesDtoDao(
"lastModifiedDate" to s.LAST_MODIFIED_DATE,
"lastModified" to s.LAST_MODIFIED_DATE,
"collection.number" to cs.NUMBER,
"name" to s.NAME
"name" to s.NAME,
"booksCount" to field(BOOKS_COUNT)
)
override fun findAll(search: SeriesSearchWithReadProgress, userId: String, pageable: Pageable): Page<SeriesDto> {