Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import java.util.Properties
import org.gradle.api.provider.Property
import org.jetbrains.kotlin.gradle.dsl.JvmTarget

val appVersionCode = 144
val appVersionName = "3.4.8"
val appVersionCode = 145
val appVersionName = "3.4.9"

plugins {
alias(libs.plugins.android.application)
Expand Down
65 changes: 52 additions & 13 deletions app/src/main/java/com/example/xtreamplayer/MainActivityUi.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5406,6 +5406,30 @@ private fun ContinueWatchingCard(
filterQuality = FilterQuality.Low,
modifier = Modifier.fillMaxSize()
)
} else {
Box(
modifier =
Modifier.fillMaxSize()
.background(
Brush.verticalGradient(
listOf(colors.surfaceAlt, colors.surface)
)
),
contentAlignment = Alignment.Center
) {
val placeholderIcon =
if (entry.resumeItem.contentType == ContentType.MOVIES) {
R.drawable.ic_category_movies
} else {
R.drawable.ic_category_series
}
Icon(
painter = painterResource(placeholderIcon),
contentDescription = null,
tint = colors.textSecondary.copy(alpha = 0.35f),
modifier = Modifier.size(48.dp)
)
}
}
if (isFavorite) {
FavoriteIndicator(modifier = Modifier.align(Alignment.TopEnd).padding(6.dp))
Expand Down Expand Up @@ -8744,6 +8768,24 @@ private data class ContinueWatchingDisplayEntry(
val timestampMs: Long
)

private fun provisionalContinueWatchingSeriesParent(item: ContentItem): ContentItem? {
if (item.contentType != ContentType.SERIES || item.containerExtension.isNullOrBlank()) {
return null
}
val parentSeriesId = item.parentSeriesId?.takeUnless { it.isBlank() } ?: return null
val parentTitle = stripEpisodeSuffixes(item.title).takeUnless { it.isBlank() } ?: item.title
return item.copy(
id = parentSeriesId,
title = parentTitle,
subtitle = "",
section = Section.SERIES,
contentType = ContentType.SERIES,
streamId = parentSeriesId,
containerExtension = null,
parentSeriesId = null
)
}

@Composable
fun ContinueWatchingScreen(
title: String,
Expand Down Expand Up @@ -8781,9 +8823,8 @@ fun ContinueWatchingScreen(
remember { androidx.compose.runtime.mutableStateMapOf<String, Boolean>() }
val posterFontScale = remember(columns) { 4f / columns.toFloat() }
val resolvedParentsSnapshot = resolvedParents.toMap()
val parentResolutionAttemptedSnapshot = parentResolutionAttempted.toMap()
val displayEntries =
remember(continueWatchingItems, resolvedParentsSnapshot, parentResolutionAttemptedSnapshot) {
remember(continueWatchingItems, resolvedParentsSnapshot) {
fun displayGroupingKey(entry: ContinueWatchingEntry): String {
val canonicalSeriesId =
entry.parentItem?.streamId?.takeUnless { it.isBlank() }
Expand Down Expand Up @@ -8820,17 +8861,11 @@ fun ContinueWatchingScreen(
}
.maxByOrNull { it.first }
?.second
val waitingForParentResolution =
group.any { entry ->
entry.item.contentType == ContentType.SERIES &&
entry.parentItem == null &&
!resolvedParentsSnapshot.containsKey(entry.key) &&
parentResolutionAttemptedSnapshot[entry.key] != true
}
if (latestSeriesParent == null && waitingForParentResolution) {
return@mapNotNull null
}
val displayItem = latestSeriesParent ?: latest.item
val provisionalSeriesParent =
latestSeriesParent
?: latest.parentItem
?: provisionalContinueWatchingSeriesParent(latest.item)
val displayItem = provisionalSeriesParent ?: latest.item
val resumeLabel =
if (latest.item.contentType == ContentType.SERIES) {
formatEpisodeLabel(latest.item, separator = " - ")?.let { "Resume $it" }
Expand Down Expand Up @@ -9210,6 +9245,10 @@ fun ContinueWatchingScreen(
val seriesItem =
resolvedParent
?: entry.parentItem
?: item.takeIf {
it.contentType == ContentType.SERIES &&
it.containerExtension.isNullOrBlank()
}
if (seriesItem != null) {
returnFocusItem = item
pendingResumeItem = entry.resumeItem
Expand Down
Loading