feat: sort series by random

Closes: #1558
This commit is contained in:
Gauthier Roebroeck 2024-12-19 11:03:47 +08:00
parent 09bc445605
commit d50646f955
3 changed files with 3 additions and 0 deletions

View File

@ -973,6 +973,7 @@
"name": "Name",
"number": "Number",
"page_count": "Page count",
"random": "Random",
"release_date": "Release date"
},
"theme": {

View File

@ -329,6 +329,7 @@ export default Vue.extend({
{name: this.$t('sort.release_date').toString(), key: 'booksMetadata.releaseDate'},
{name: this.$t('sort.folder_name').toString(), key: 'name'},
{name: this.$t('sort.books_count').toString(), key: 'booksCount'},
{name: this.$t('sort.random').toString(), key: 'random'},
] as SortOption[]
},
filterOptionsList(): FiltersOptions {

View File

@ -94,6 +94,7 @@ class SeriesDtoDao(
"collection.number" to cs.NUMBER,
"name" to s.NAME.collate(SqliteUdfDataSource.COLLATION_UNICODE_3),
"booksCount" to s.BOOK_COUNT,
"random" to DSL.rand(),
)
override fun findAll(pageable: Pageable): Page<SeriesDto> = findAll(SeriesSearch(), SearchContext.ofAnonymousUser(), pageable)