mirror of
https://github.com/JustinZeus/Wholphin.git
synced 2026-07-08 23:51:21 +02:00
Minor UI tweaks (#586)
## Description - Show unwatched counts on the cards in the latest rows instead of child count, which is more in line with the web UI & official app - Show exact runtime on the overview dialog for each version - Don't show controls after clicking up next ### Related issues Closes #431
This commit is contained in:
parent
9ae4965c2a
commit
ad64f9a136
3 changed files with 18 additions and 3 deletions
|
|
@ -32,6 +32,7 @@ import org.jellyfin.sdk.model.api.MediaStream
|
||||||
import org.jellyfin.sdk.model.api.MediaStreamType
|
import org.jellyfin.sdk.model.api.MediaStreamType
|
||||||
import org.jellyfin.sdk.model.api.VideoRange
|
import org.jellyfin.sdk.model.api.VideoRange
|
||||||
import org.jellyfin.sdk.model.api.VideoRangeType
|
import org.jellyfin.sdk.model.api.VideoRangeType
|
||||||
|
import org.jellyfin.sdk.model.extensions.ticks
|
||||||
import java.util.Locale
|
import java.util.Locale
|
||||||
|
|
||||||
data class ItemDetailsDialogInfo(
|
data class ItemDetailsDialogInfo(
|
||||||
|
|
@ -56,6 +57,7 @@ fun ItemDetailsDialog(
|
||||||
val subtitleLabel = stringResource(R.string.subtitle)
|
val subtitleLabel = stringResource(R.string.subtitle)
|
||||||
val bitrateLabel = stringResource(R.string.bitrate)
|
val bitrateLabel = stringResource(R.string.bitrate)
|
||||||
val unknown = stringResource(R.string.unknown)
|
val unknown = stringResource(R.string.unknown)
|
||||||
|
val runtimeLabel = stringResource(R.string.runtime_sort)
|
||||||
|
|
||||||
ScrollableDialog(
|
ScrollableDialog(
|
||||||
onDismissRequest = onDismissRequest,
|
onDismissRequest = onDismissRequest,
|
||||||
|
|
@ -117,6 +119,9 @@ fun ItemDetailsDialog(
|
||||||
bitrateLabel to formatBytes(it, byteRateSuffixes),
|
bitrateLabel to formatBytes(it, byteRateSuffixes),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
source.runTimeTicks?.let {
|
||||||
|
add(runtimeLabel to it.ticks.toString())
|
||||||
|
}
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -48,6 +48,7 @@ import com.github.damontecres.wholphin.data.model.BaseItem
|
||||||
import com.github.damontecres.wholphin.preferences.UserPreferences
|
import com.github.damontecres.wholphin.preferences.UserPreferences
|
||||||
import com.github.damontecres.wholphin.ui.AspectRatios
|
import com.github.damontecres.wholphin.ui.AspectRatios
|
||||||
import com.github.damontecres.wholphin.ui.Cards
|
import com.github.damontecres.wholphin.ui.Cards
|
||||||
|
import com.github.damontecres.wholphin.ui.abbreviateNumber
|
||||||
import com.github.damontecres.wholphin.ui.cards.BannerCard
|
import com.github.damontecres.wholphin.ui.cards.BannerCard
|
||||||
import com.github.damontecres.wholphin.ui.cards.ItemRow
|
import com.github.damontecres.wholphin.ui.cards.ItemRow
|
||||||
import com.github.damontecres.wholphin.ui.components.CircularProgress
|
import com.github.damontecres.wholphin.ui.components.CircularProgress
|
||||||
|
|
@ -360,13 +361,21 @@ fun HomePageContent(
|
||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
.animateItem(),
|
.animateItem(),
|
||||||
cardContent = { index, item, cardModifier, onClick, onLongClick ->
|
cardContent = { index, item, cardModifier, onClick, onLongClick ->
|
||||||
|
val cornerText =
|
||||||
|
remember {
|
||||||
|
item?.data?.indexNumber?.let { "E$it" }
|
||||||
|
?: item
|
||||||
|
?.data
|
||||||
|
?.userData
|
||||||
|
?.unplayedItemCount
|
||||||
|
?.takeIf { it > 0 }
|
||||||
|
?.let { abbreviateNumber(it) }
|
||||||
|
}
|
||||||
BannerCard(
|
BannerCard(
|
||||||
name = item?.data?.seriesName ?: item?.name,
|
name = item?.data?.seriesName ?: item?.name,
|
||||||
item = item,
|
item = item,
|
||||||
aspectRatio = AspectRatios.TALL,
|
aspectRatio = AspectRatios.TALL,
|
||||||
cornerText =
|
cornerText = cornerText,
|
||||||
item?.data?.indexNumber?.let { "E$it" }
|
|
||||||
?: item?.data?.childCount?.let { if (it > 0) it.toString() else null },
|
|
||||||
played = item?.data?.userData?.played ?: false,
|
played = item?.data?.userData?.played ?: false,
|
||||||
favorite = item?.favorite ?: false,
|
favorite = item?.favorite ?: false,
|
||||||
playPercent =
|
playPercent =
|
||||||
|
|
|
||||||
|
|
@ -483,6 +483,7 @@ fun PlaybackPage(
|
||||||
aspectRatio = it.aspectRatio ?: AspectRatios.WIDE,
|
aspectRatio = it.aspectRatio ?: AspectRatios.WIDE,
|
||||||
onClick = {
|
onClick = {
|
||||||
viewModel.reportInteraction()
|
viewModel.reportInteraction()
|
||||||
|
controllerViewState.hideControls()
|
||||||
viewModel.playNextUp()
|
viewModel.playNextUp()
|
||||||
},
|
},
|
||||||
timeLeft = if (autoPlayEnabled) timeLeft.seconds else null,
|
timeLeft = if (autoPlayEnabled) timeLeft.seconds else null,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue