diff --git a/komga-webui/src/locales/en.json b/komga-webui/src/locales/en.json index 1a1877bb2..8b349ebce 100644 --- a/komga-webui/src/locales/en.json +++ b/komga-webui/src/locales/en.json @@ -973,6 +973,7 @@ "name": "Name", "number": "Number", "page_count": "Page count", + "random": "Random", "release_date": "Release date" }, "theme": { diff --git a/komga-webui/src/views/BrowseLibraries.vue b/komga-webui/src/views/BrowseLibraries.vue index b62462bdf..d423f3e4f 100644 --- a/komga-webui/src/views/BrowseLibraries.vue +++ b/komga-webui/src/views/BrowseLibraries.vue @@ -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 { diff --git a/komga/src/main/kotlin/org/gotson/komga/infrastructure/jooq/main/SeriesDtoDao.kt b/komga/src/main/kotlin/org/gotson/komga/infrastructure/jooq/main/SeriesDtoDao.kt index 93d5703c2..6af28e4ac 100644 --- a/komga/src/main/kotlin/org/gotson/komga/infrastructure/jooq/main/SeriesDtoDao.kt +++ b/komga/src/main/kotlin/org/gotson/komga/infrastructure/jooq/main/SeriesDtoDao.kt @@ -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 = findAll(SeriesSearch(), SearchContext.ofAnonymousUser(), pageable)