mirror of
https://github.com/gotson/komga.git
synced 2026-01-05 23:36:07 +01:00
parent
c9de7c8074
commit
1d583229ee
1 changed files with 2 additions and 3 deletions
|
|
@ -10,7 +10,6 @@ import org.gotson.komga.domain.model.PathContainedInPath
|
|||
import org.gotson.komga.domain.persistence.BookRepository
|
||||
import org.gotson.komga.domain.persistence.LibraryRepository
|
||||
import org.gotson.komga.infrastructure.security.KomgaPrincipal
|
||||
import org.springframework.data.domain.Sort
|
||||
import org.springframework.data.repository.findByIdOrNull
|
||||
import org.springframework.http.HttpStatus
|
||||
import org.springframework.http.MediaType
|
||||
|
|
@ -46,10 +45,10 @@ class LibraryController(
|
|||
@AuthenticationPrincipal principal: KomgaPrincipal
|
||||
): List<LibraryDto> =
|
||||
if (principal.user.sharedAllLibraries) {
|
||||
libraryRepository.findAll(Sort.by("name"))
|
||||
libraryRepository.findAll()
|
||||
} else {
|
||||
principal.user.sharedLibraries
|
||||
}.map { it.toDto(includeRoot = principal.user.isAdmin()) }
|
||||
}.sortedBy { it.name }.map { it.toDto(includeRoot = principal.user.isAdmin()) }
|
||||
|
||||
@GetMapping("{id}")
|
||||
fun getOne(
|
||||
|
|
|
|||
Loading…
Reference in a new issue