Fix progress bar

This commit is contained in:
2026-01-17 18:05:27 +01:00
parent 876bc03696
commit 3bd8d423d2
3 changed files with 5 additions and 4 deletions

View File

@@ -49,7 +49,7 @@ class HomePageViewModel @Inject constructor(
id = it.id,
primaryText = it.seriesName!!,
secondaryText = it.name!!,
progress = it.userData!!.playedPercentage!!.toFloat(),
progress = it.userData!!.playedPercentage!!,
colors = listOf(Color.Red, Color.Green),
)
} else {
@@ -58,7 +58,7 @@ class HomePageViewModel @Inject constructor(
primaryText = it.name!!,
secondaryText = it.premiereDate!!.format(DateTimeFormatter.ofLocalizedDate(
FormatStyle.MEDIUM)),
progress = it.userData!!.playedPercentage!!.toFloat(),
progress = it.userData!!.playedPercentage!!,
colors = listOf(Color.Red, Color.Green)
)
}

View File

@@ -8,7 +8,7 @@ data class ContinueWatchingItem(
val id: UUID,
val primaryText: String,
val secondaryText: String,
val progress: Float,
val progress: Double,
val colors: List<Color>
)

View File

@@ -33,6 +33,7 @@ import androidx.compose.ui.unit.sp
import coil3.compose.AsyncImage
import hu.bbara.purefin.image.JellyfinImageHelper
import org.jellyfin.sdk.model.api.ImageType
import kotlin.math.nextUp
@Composable
fun ContinueWatchingSection(
@@ -105,7 +106,7 @@ fun ContinueWatchingCard(
Box(
modifier = Modifier
.fillMaxHeight()
.fillMaxWidth(item.progress)
.fillMaxWidth(item.progress.toFloat().nextUp().div(100))
.background(colors.primary)
)
}