Sort items alphabetical on name
This commit is contained in:
parent
07d9ae676c
commit
c7a816ff6f
2 changed files with 10 additions and 3 deletions
|
@ -3,6 +3,7 @@ package dev.jdtech.jellyfin.repository
|
|||
import org.jellyfin.sdk.model.api.BaseItemDto
|
||||
import org.jellyfin.sdk.model.api.ItemFields
|
||||
import org.jellyfin.sdk.model.api.MediaSourceInfo
|
||||
import org.jellyfin.sdk.model.api.SortOrder
|
||||
import java.util.*
|
||||
|
||||
interface JellyfinRepository {
|
||||
|
@ -13,7 +14,9 @@ interface JellyfinRepository {
|
|||
suspend fun getItems(
|
||||
parentId: UUID? = null,
|
||||
includeTypes: List<String>? = null,
|
||||
recursive: Boolean = false
|
||||
recursive: Boolean = false,
|
||||
sortBy: String = "SortName",
|
||||
sortOrder: SortOrder = SortOrder.ASCENDING
|
||||
): List<BaseItemDto>
|
||||
|
||||
suspend fun getFavoriteItems(): List<BaseItemDto>
|
||||
|
|
|
@ -28,7 +28,9 @@ class JellyfinRepositoryImpl(private val jellyfinApi: JellyfinApi) : JellyfinRep
|
|||
override suspend fun getItems(
|
||||
parentId: UUID?,
|
||||
includeTypes: List<String>?,
|
||||
recursive: Boolean
|
||||
recursive: Boolean,
|
||||
sortBy: String,
|
||||
sortOrder: SortOrder
|
||||
): List<BaseItemDto> {
|
||||
val items: List<BaseItemDto>
|
||||
withContext(Dispatchers.IO) {
|
||||
|
@ -36,7 +38,9 @@ class JellyfinRepositoryImpl(private val jellyfinApi: JellyfinApi) : JellyfinRep
|
|||
jellyfinApi.userId!!,
|
||||
parentId = parentId,
|
||||
includeItemTypes = includeTypes,
|
||||
recursive = recursive
|
||||
recursive = recursive,
|
||||
sortBy = listOf(sortBy),
|
||||
sortOrder = listOf(sortOrder)
|
||||
).content.items ?: listOf()
|
||||
}
|
||||
return items
|
||||
|
|
Loading…
Reference in a new issue