diff --git a/komga/src/main/kotlin/org/gotson/komga/infrastructure/jooq/ReadListDao.kt b/komga/src/main/kotlin/org/gotson/komga/infrastructure/jooq/ReadListDao.kt index fcae9ac60..00d32183e 100644 --- a/komga/src/main/kotlin/org/gotson/komga/infrastructure/jooq/ReadListDao.kt +++ b/komga/src/main/kotlin/org/gotson/komga/infrastructure/jooq/ReadListDao.kt @@ -37,6 +37,8 @@ class ReadListDao( private val sorts = mapOf( "name" to rl.NAME.collate(SqliteUdfDataSource.collationUnicode3), + "createdDate" to rl.CREATED_DATE, + "lastModifiedDate" to rl.LAST_MODIFIED_DATE, ) override fun findByIdOrNull(readListId: String, filterOnLibraryIds: Collection?, restrictions: ContentRestrictions): ReadList? = diff --git a/komga/src/main/kotlin/org/gotson/komga/interfaces/api/rest/ReadListController.kt b/komga/src/main/kotlin/org/gotson/komga/interfaces/api/rest/ReadListController.kt index 8fa343063..5ca0fe8a2 100644 --- a/komga/src/main/kotlin/org/gotson/komga/interfaces/api/rest/ReadListController.kt +++ b/komga/src/main/kotlin/org/gotson/komga/interfaces/api/rest/ReadListController.kt @@ -103,6 +103,7 @@ class ReadListController( @Parameter(hidden = true) page: Pageable, ): Page { val sort = when { + page.sort.isSorted -> page.sort !searchTerm.isNullOrBlank() -> Sort.by("relevance") else -> Sort.by(Sort.Order.asc("name")) }