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
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,8 @@ class CloudSyncRepository @Inject constructor(
val trailerSoundEnabled: Boolean = false,
val trailerDelaySeconds: Int = 1,
val trailerInCards: Boolean = true,
// Null from older clients: keep the local preference.
val netflixHomeStyle: Boolean? = null,
val clockFormat: String = "24h",
val guideRowCount: Int? = null,
val showBudget: Boolean = true,
Expand Down Expand Up @@ -345,6 +347,8 @@ class CloudSyncRepository @Inject constructor(
profileManager.profileBooleanKeyFor(profileId, "trailer_sound_enabled")
private fun trailerInCardsKeyFor(profileId: String) =
profileManager.profileBooleanKeyFor(profileId, "trailer_in_cards")
private fun netflixHomeStyleKeyFor(profileId: String) =
profileManager.profileBooleanKeyFor(profileId, com.arflix.tv.ui.screens.home.NETFLIX_HOME_STYLE_KEY)
private fun trailerDelayKeyFor(profileId: String) =
profileManager.profileStringKeyFor(profileId, "trailer_delay_seconds")
private fun clockFormatKeyFor(profileId: String) =
Expand Down Expand Up @@ -688,6 +692,7 @@ class CloudSyncRepository @Inject constructor(
trailerSoundEnabled = prefs[trailerSoundEnabledKeyFor(profile.id)] ?: false,
trailerDelaySeconds = prefs[trailerDelayKeyFor(profile.id)]?.toIntOrNull() ?: 1,
trailerInCards = prefs[trailerInCardsKeyFor(profile.id)] ?: true,
netflixHomeStyle = prefs[netflixHomeStyleKeyFor(profile.id)] ?: true,
clockFormat = prefs[clockFormatKeyFor(profile.id)] ?: "24h",
guideRowCount = prefs[guideRowCountKeyFor(profile.id)]?.toIntOrNull()
?.takeIf { it in 6..10 } ?: 0,
Expand Down Expand Up @@ -1621,6 +1626,7 @@ class CloudSyncRepository @Inject constructor(
prefs[trailerSoundEnabledKeyFor(profileId)] = state.trailerSoundEnabled
prefs[trailerDelayKeyFor(profileId)] = state.trailerDelaySeconds.toString()
prefs[trailerInCardsKeyFor(profileId)] = state.trailerInCards
state.netflixHomeStyle?.let { prefs[netflixHomeStyleKeyFor(profileId)] = it }
prefs[clockFormatKeyFor(profileId)] = state.clockFormat
// Older clients omit this field; keep the local preference in that case.
state.guideRowCount?.let { count ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,15 @@ import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.combine
import kotlinx.coroutines.flow.distinctUntilChanged

/** Per-profile toggle for the Netflix-style TV Home (billboard + expanding row cards). */
internal const val NETFLIX_HOME_STYLE_KEY = "netflix_home_style"

internal data class HomeProfilePreferences(
val trailerAutoPlay: Boolean,
val trailerSoundEnabled: Boolean,
val trailerDelaySeconds: Int,
val trailerInCards: Boolean,
val netflixHomeStyle: Boolean,
val showBudget: Boolean,
val iptvFavoritesOnHome: Boolean,
val clockFormat: String,
Expand All @@ -33,6 +37,7 @@ internal fun readHomeProfilePreferences(
trailerDelaySeconds = preferences[stringPreferencesKey("${prefix}trailer_delay_seconds")]
?.toIntOrNull() ?: 1,
trailerInCards = preferences[booleanPreferencesKey("${prefix}trailer_in_cards")] ?: true,
netflixHomeStyle = preferences[booleanPreferencesKey("$prefix$NETFLIX_HOME_STYLE_KEY")] ?: true,
showBudget = preferences[booleanPreferencesKey("${prefix}show_budget_on_home")] ?: true,
iptvFavoritesOnHome = preferences[
booleanPreferencesKey("$prefix$IPTV_FAVORITES_ON_HOME")
Expand Down
232 changes: 196 additions & 36 deletions app/src/main/kotlin/com/arflix/tv/ui/screens/home/HomeScreen.kt

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ data class HomeUiState(
val trailerSoundEnabled: Boolean = false,
val trailerDelaySeconds: Int = 1,
val trailerInCards: Boolean = true,
val netflixHomeStyle: Boolean = true,
// Home hero metadata visibility toggles (issue #72)
val showBudget: Boolean = true,
val heroOverviewOverride: String? = null,
Expand Down Expand Up @@ -2059,6 +2060,7 @@ class HomeViewModel @Inject constructor(
trailerSoundEnabled = preferences.trailerSoundEnabled,
trailerDelaySeconds = preferences.trailerDelaySeconds,
trailerInCards = preferences.trailerInCards,
netflixHomeStyle = preferences.netflixHomeStyle,
showBudget = preferences.showBudget,
clockFormat = preferences.clockFormat,
smoothScrolling = preferences.smoothScrolling
Expand Down
Loading
Loading