mirror of
https://github.com/JustinZeus/Wholphin.git
synced 2026-07-09 16:11:20 +02:00
Better collection pages including more view options (#1137)
## Description This is a large update to the collection page! - Show the collection's details including overview & backdrop - Separate collection by type (Movies, TV, etc) into rows - View options are now shared across all collections - Filter & sort are still saved per collection By default, the collection will be separated by type, but there is a view option to restore the combined grid. ### Related issues Closes #527 Closes #1088 Fixes https://github.com/damontecres/Wholphin/issues/877#issuecomment-3889013124 Related to #737 ### Testing Emulator mostly ## Screenshots  ### Separated types into rows  ### Combined type into grid  ## AI or LLM usage None
This commit is contained in:
parent
b8a9cb5027
commit
c35b5cdd0a
21 changed files with 1853 additions and 59 deletions
|
|
@ -7,6 +7,7 @@ import androidx.room.Query
|
|||
import com.github.damontecres.wholphin.data.model.JellyfinUser
|
||||
import com.github.damontecres.wholphin.data.model.LibraryDisplayInfo
|
||||
import com.github.damontecres.wholphin.ui.toServerString
|
||||
import kotlinx.coroutines.flow.Flow
|
||||
import java.util.UUID
|
||||
|
||||
@Dao
|
||||
|
|
@ -27,6 +28,12 @@ interface LibraryDisplayInfoDao {
|
|||
itemId: String,
|
||||
): LibraryDisplayInfo?
|
||||
|
||||
@Query("SELECT * from LibraryDisplayInfo WHERE userId=:userId AND itemId=:itemId")
|
||||
fun getItemAsFlow(
|
||||
userId: Int,
|
||||
itemId: String,
|
||||
): Flow<LibraryDisplayInfo?>
|
||||
|
||||
@Insert(onConflict = OnConflictStrategy.REPLACE)
|
||||
fun saveItem(item: LibraryDisplayInfo): Long
|
||||
|
||||
|
|
|
|||
|
|
@ -127,6 +127,9 @@ data class BaseItem(
|
|||
} else if (data.premiereDate != null) {
|
||||
add(data.premiereDate!!.toLocalDate().toString())
|
||||
}
|
||||
} else if (type == BaseItemKind.BOX_SET) {
|
||||
data.productionYear?.let { add(it.toString()) }
|
||||
data.childCount?.let { add("$it items") }
|
||||
} else {
|
||||
data.productionYear?.let { add(it.toString()) }
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,12 +9,14 @@ import androidx.room.Ignore
|
|||
import androidx.room.Index
|
||||
import com.github.damontecres.wholphin.ui.components.ViewOptions
|
||||
import com.github.damontecres.wholphin.ui.data.SortAndDirection
|
||||
import com.github.damontecres.wholphin.ui.toServerString
|
||||
import kotlinx.serialization.Serializable
|
||||
import kotlinx.serialization.Transient
|
||||
import kotlinx.serialization.UseSerializers
|
||||
import org.jellyfin.sdk.model.api.ItemSortBy
|
||||
import org.jellyfin.sdk.model.api.SortOrder
|
||||
import org.jellyfin.sdk.model.serializer.UUIDSerializer
|
||||
import java.util.UUID
|
||||
|
||||
@Entity(
|
||||
foreignKeys = [
|
||||
|
|
@ -41,4 +43,13 @@ data class LibraryDisplayInfo(
|
|||
) {
|
||||
@Ignore @Transient
|
||||
val sortAndDirection = SortAndDirection(sort, direction)
|
||||
|
||||
constructor(
|
||||
user: JellyfinUser,
|
||||
itemId: UUID,
|
||||
sort: ItemSortBy,
|
||||
direction: SortOrder,
|
||||
filter: GetItemsFilter,
|
||||
viewOptions: ViewOptions?,
|
||||
) : this(user.rowId, itemId.toServerString(), sort, direction, filter, viewOptions)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue