Update item fields queried & expand usage of primary aspect ratio (#1852)
## Description Slight optimization to remove "child count" for grid pages. Adds back "primary image aspect ratio" for several queries where its necessary. Also updates extras cards to use the "primary image aspect ratio" instead of a hard coded value. Dev note: some light refactoring is also in this PR including renaming the item fields lists to better reflect the intended usage in code ### Related issues Fixes #1843 ### Testing Emulator, I tested many pages and views, but probably need to do "real world" testing to see if I missed anything ## Screenshots N/A ## AI or LLM usage None
This commit is contained in:
parent
c4264a3263
commit
b064af7c4e
16 changed files with 105 additions and 83 deletions
|
|
@ -74,6 +74,7 @@ class ExtrasService
|
|||
items.size,
|
||||
items.size,
|
||||
)
|
||||
val itemForImage = items.random()
|
||||
ExtrasItem.Group(
|
||||
parentId = itemId,
|
||||
type = type,
|
||||
|
|
@ -83,9 +84,10 @@ class ExtrasService
|
|||
isPlayed = items.all { it.played },
|
||||
imageUrl =
|
||||
imageUrlService.getItemImageUrl(
|
||||
items.random(),
|
||||
itemForImage,
|
||||
ImageType.PRIMARY,
|
||||
),
|
||||
aspectRatio = itemForImage.aspectRatio,
|
||||
)
|
||||
} else {
|
||||
null
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ import com.github.damontecres.wholphin.data.model.AudioItem
|
|||
import com.github.damontecres.wholphin.data.model.BaseItem
|
||||
import com.github.damontecres.wholphin.preferences.get
|
||||
import com.github.damontecres.wholphin.services.hilt.DefaultCoroutineScope
|
||||
import com.github.damontecres.wholphin.ui.DefaultItemFields
|
||||
import com.github.damontecres.wholphin.ui.DetailItemFields
|
||||
import com.github.damontecres.wholphin.ui.gt
|
||||
import com.github.damontecres.wholphin.ui.main.settings.MoveDirection
|
||||
import com.github.damontecres.wholphin.ui.onMain
|
||||
|
|
@ -180,7 +180,7 @@ class MusicService
|
|||
userId = serverRepository.currentUser?.id,
|
||||
itemId = itemId,
|
||||
limit = 200,
|
||||
fields = DefaultItemFields,
|
||||
fields = DetailItemFields,
|
||||
).content.items
|
||||
.map { BaseItem(it, false) }
|
||||
setQueue(items, false)
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ import com.github.damontecres.wholphin.data.model.GetItemsFilter
|
|||
import com.github.damontecres.wholphin.data.model.Playlist
|
||||
import com.github.damontecres.wholphin.data.model.PlaylistInfo
|
||||
import com.github.damontecres.wholphin.data.model.PlaylistItem
|
||||
import com.github.damontecres.wholphin.ui.DefaultItemFields
|
||||
import com.github.damontecres.wholphin.ui.DetailItemFields
|
||||
import com.github.damontecres.wholphin.ui.components.baseItemKinds
|
||||
import com.github.damontecres.wholphin.ui.data.SortAndDirection
|
||||
import com.github.damontecres.wholphin.ui.gt
|
||||
|
|
@ -65,7 +65,7 @@ class PlaylistCreator
|
|||
GetEpisodesRequest(
|
||||
seriesId = seriesId,
|
||||
seasonId = seasonId,
|
||||
fields = DefaultItemFields,
|
||||
fields = DetailItemFields,
|
||||
startItemId = episodeId,
|
||||
sortBy = if (shuffled) ItemSortBy.RANDOM else null,
|
||||
limit = Playlist.MAX_SIZE,
|
||||
|
|
@ -94,7 +94,7 @@ class PlaylistCreator
|
|||
GetItemsRequest(
|
||||
userId = serverRepository.currentUser?.id,
|
||||
parentId = playlistId,
|
||||
fields = DefaultItemFields,
|
||||
fields = DetailItemFields,
|
||||
startIndex = startIndex,
|
||||
limit = Playlist.MAX_SIZE,
|
||||
sortBy = listOf(sortAndDirection.sort),
|
||||
|
|
@ -135,7 +135,7 @@ class PlaylistCreator
|
|||
excludeItemIds = listOf(item.id),
|
||||
sortBy = sortAndDirection?.let { listOf(sortAndDirection.sort) },
|
||||
sortOrder = sortAndDirection?.let { listOf(sortAndDirection.direction) },
|
||||
fields = DefaultItemFields,
|
||||
fields = DetailItemFields,
|
||||
startIndex = startIndex,
|
||||
limit = Playlist.MAX_SIZE,
|
||||
excludeLocationTypes = listOf(LocationType.VIRTUAL),
|
||||
|
|
@ -208,7 +208,7 @@ class PlaylistCreator
|
|||
seasonId = item.id,
|
||||
limit = Playlist.MAX_SIZE,
|
||||
sortBy = ItemSortBy.RANDOM,
|
||||
fields = DefaultItemFields,
|
||||
fields = DetailItemFields,
|
||||
).content.items
|
||||
.convertAndAddParts()
|
||||
.let {
|
||||
|
|
@ -236,7 +236,7 @@ class PlaylistCreator
|
|||
seriesId = item.id,
|
||||
limit = Playlist.MAX_SIZE,
|
||||
sortBy = ItemSortBy.RANDOM,
|
||||
fields = DefaultItemFields,
|
||||
fields = DetailItemFields,
|
||||
).content.items
|
||||
.convertAndAddParts()
|
||||
.let {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue