mirror of
https://github.com/owenlejeune/TVTime.git
synced 2026-01-05 22:31:18 -05:00
some fixes for Next MCU extra
This commit is contained in:
@@ -8,7 +8,7 @@ import org.koin.core.parameter.parametersOf
|
||||
class NextMCUClient: KoinComponent {
|
||||
|
||||
companion object {
|
||||
private const val BASE_URL = "https://www.whenisthenextmcufilm.com/"
|
||||
private const val BASE_URL = "https://dev.whenisthenextmcufilm.com/"
|
||||
}
|
||||
|
||||
private val client: Client by inject { parametersOf(BASE_URL) }
|
||||
|
||||
@@ -7,6 +7,7 @@ import java.util.Date
|
||||
class NextMCU(
|
||||
@SerializedName("days_until") val daysUntil: Int,
|
||||
@SerializedName("title") val title: String,
|
||||
@SerializedName("id") val id: Int,
|
||||
@SerializedName("overview") val overview: String,
|
||||
@SerializedName("poster_url") val posterUrl: String?,
|
||||
@SerializedName("release_date") val releaseDate: Date,
|
||||
|
||||
@@ -89,12 +89,14 @@ fun DetailHeader(
|
||||
)
|
||||
|
||||
rating?.let {
|
||||
if (it > 0f) {
|
||||
RatingView(
|
||||
progress = rating
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
|
||||
@@ -377,7 +377,7 @@ private fun MediaViewContent(
|
||||
mediaItem?.productionCompanies?.firstOrNull { it.name == "Marvel Studios" } != null
|
||||
&& preferences.showNextMcuProduction
|
||||
) {
|
||||
NextMcuProjectCard(appNavController = appNavController)
|
||||
NextMcuProjectCard(itemId = itemId, appNavController = appNavController)
|
||||
}
|
||||
|
||||
if (windowSize != WindowSizeClass.Expanded) {
|
||||
@@ -472,11 +472,13 @@ private fun MiscDetails(
|
||||
.wrapContentHeight()
|
||||
) {
|
||||
Text(text = year, color = MaterialTheme.colorScheme.onBackground)
|
||||
if (runtime != "0m") {
|
||||
Text(
|
||||
text = runtime,
|
||||
color = MaterialTheme.colorScheme.onBackground,
|
||||
modifier = Modifier.padding(start = 12.dp)
|
||||
)
|
||||
}
|
||||
Text(
|
||||
text = contentRating,
|
||||
color = MaterialTheme.colorScheme.onBackground,
|
||||
@@ -870,6 +872,7 @@ fun SimilarContentCard(
|
||||
val pagingItems = similarContent?.collectAsLazyPagingItems()
|
||||
|
||||
pagingItems?.let {
|
||||
if (it.itemCount > 0) {
|
||||
ContentCard(
|
||||
modifier = modifier,
|
||||
title = stringResource(id = R.string.recommended_label)
|
||||
@@ -908,6 +911,7 @@ fun SimilarContentCard(
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
@@ -1099,6 +1103,7 @@ private fun WatchProviderContainer(
|
||||
|
||||
@Composable
|
||||
private fun NextMcuProjectCard(
|
||||
itemId: Int,
|
||||
appNavController: NavController,
|
||||
modifier: Modifier = Modifier
|
||||
) {
|
||||
@@ -1110,12 +1115,23 @@ private fun NextMcuProjectCard(
|
||||
|
||||
val nextMcuProject = remember { viewModel.nextMcuProject }
|
||||
|
||||
if (nextMcuProject.value?.id != itemId) {
|
||||
Card(
|
||||
shape = RoundedCornerShape(10.dp),
|
||||
elevation = CardDefaults.cardElevation(defaultElevation = 10.dp),
|
||||
colors = CardDefaults.cardColors(containerColor = MaterialTheme.colorScheme.surfaceVariant),
|
||||
modifier = modifier.then(Modifier
|
||||
.fillMaxWidth()
|
||||
.clickable {
|
||||
nextMcuProject.value?.let {
|
||||
appNavController.navigate(
|
||||
AppNavItem.DetailView.withArgs(
|
||||
it.type,
|
||||
it.id
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
)
|
||||
) {
|
||||
Box(
|
||||
@@ -1179,6 +1195,7 @@ private fun NextMcuProjectCard(
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
|
||||
Reference in New Issue
Block a user