Skip to content

Commit

Permalink
feat: sort series by books count
Browse files Browse the repository at this point in the history
closes #459
  • Loading branch information
gotson committed Mar 15, 2021
1 parent 3b95629 commit b51e491
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions komga-webui/src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,7 @@
"role_user": "User"
},
"sort": {
"books_count": "Books count",
"date_added": "Date added",
"date_updated": "Date updated",
"file_name": "Filename",
Expand Down
1 change: 1 addition & 0 deletions komga-webui/src/views/BrowseLibraries.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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> {
Expand Down

0 comments on commit b51e491

Please sign in to comment.