StreamVault is a TV-first free IPTV player for Android TV built with Kotlin, Jetpack Compose, Room, Hilt, and Media3.
Kotlin iptv-player
refactor(live): extract epg category lock policy
David Nashash62124ade0a92
diff --git a/app/src/main/java/com/streamvault/app/ui/screens/epg/EpgScreen.kt b/app/src/main/java/com/streamvault/app/ui/screens/epg/EpgScreen.ktindex 12cecdfc..737c94a7 100644--- a/app/src/main/java/com/streamvault/app/ui/screens/epg/EpgScreen.kt+++ b/app/src/main/java/com/streamvault/app/ui/screens/epg/EpgScreen.kt@@ -6,6 +6,7 @@ import com.streamvault.domain.playback.archivePlaybackCapabilityimport com.streamvault.domain.playback.isArchivePlayableimport com.streamvault.feature.live.presentation.epg.resolveLiveGuideFocusimport com.streamvault.feature.live.presentation.epg.isLiveGuideChannelLocked+import com.streamvault.feature.live.presentation.epg.isLiveGuideCategoryLockedimport com.streamvault.feature.live.presentation.epg.LiveGuideNowProviderimport com.streamvault.feature.live.presentation.epg.currentLiveGuideNowimport com.streamvault.feature.live.presentation.epg.LiveGuideSearchOverlay@@ -976,7 +977,7 @@ private fun GuideProviderTroubleshootingCard(}internal fun isGuideCategoryLocked(category: Category, parentalControlLevel: Int): Boolean =- parentalControlLevel in 1..2 && (category.isAdult || category.isUserProtected)+ isLiveGuideCategoryLocked(category, parentalControlLevel)private fun isGuideChannelLocked(channel: Channel,diff --git a/docs/COMPOSE_REDUCTION_PHASE5_TRANSITIONAL_DEPENDENCIES.md b/docs/COMPOSE_REDUCTION_PHASE5_TRANSITIONAL_DEPENDENCIES.mdindex 3b0802cd..6af80bbb 100644--- a/docs/COMPOSE_REDUCTION_PHASE5_TRANSITIONAL_DEPENDENCIES.md+++ b/docs/COMPOSE_REDUCTION_PHASE5_TRANSITIONAL_DEPENDENCIES.md@@ -141,7 +141,7 @@ pane, guide toolbar, guide message state, hero badge, timeline header, gridrows/cells, grid host, EPG content host, focus reconciliation, Home layoutmetrics, and Home parental-lock policy are now feature-owned, with the optionsoverlay and EPG-match dialog also feature-owned-and the EPG guide-channel lock policy now feature-owned+and the EPG guide category/channel lock policies now feature-ownedwhile the Home and EPGscreen/dialog composition remains in `:app` for the remaining app-specificdialogs.@@ -155,7 +155,8 @@ series-assignment dialogs, the EPG search overlay, guide category picker, andcompact guide-program dialog, guide control rows, EPG preview pane, guidetoolbar, guide message state, hero badge, stable EPG channel-key helper,timeline header, grid rows/cells, grid host, EPG content host, focus-reconciliation, Home layout metrics, Home parental-lock policy, EPG guide-channel-lock policy, options overlay, and EPG-match dialog are independent of app code;+reconciliation, Home layout metrics, Home parental-lock policy, EPG guide+category/channel lock policies, options overlay, and EPG-match dialog are+independent of app code;screen/resource moves, golden/runtime/performance gates, and legacy app cleanupremain open, so no live slice acceptance gate is claimed yet.diff --git a/docs/superpowers/plans/2026-08-28-live-feature-extraction.md b/docs/superpowers/plans/2026-08-28-live-feature-extraction.mdindex b7fb1a14..1dd6ddee 100644--- a/docs/superpowers/plans/2026-08-28-live-feature-extraction.md+++ b/docs/superpowers/plans/2026-08-28-live-feature-extraction.md@@ -31,7 +31,7 @@ pane, guide toolbar, guide message state, hero badge, timeline header, gridrows/cells, grid host, EPG content host, focus reconciliation, Home layoutmetrics, and Home parental-lock policy are now feature-owned, with the optionsoverlay and EPG-match dialog also feature-owned-and the EPG guide-channel lock policy now feature-owned+and the EPG guide category/channel lock policies now feature-ownedand their feature checks are green. Home screen/dialog composition, theremaining live cards/rows, complete locale resource migration, and acceptancegates remain open.@@ -733,8 +733,8 @@ device inputs. Home parental-lock policy likewise preserves normalized unlockIDs and selected/source-category protection behind feature-owned purepredicates while the app supplies current state. EPG guide-channel lock policynow preserves the existing parental-control level, channel protection, and-source-category protection behind a feature-owned pure predicate; `EpgScreen`-keeps its compatibility wrapper while supplying current state.+source-category protection behind feature-owned pure predicates; `EpgScreen`+keeps its compatibility wrappers while supplying current state.quick-filter key/selection rules are covered by `LiveQuickFiltersTest`. Theremaining app-owned live cards and shell/dialog composition still requirecompatibility seams before the full Home move.diff --git a/feature/live/src/main/java/com/streamvault/feature/live/presentation/epg/LiveGuideLockPolicy.kt b/feature/live/src/main/java/com/streamvault/feature/live/presentation/epg/LiveGuideLockPolicy.ktindex c83c73fa..edbc8d53 100644--- a/feature/live/src/main/java/com/streamvault/feature/live/presentation/epg/LiveGuideLockPolicy.kt+++ b/feature/live/src/main/java/com/streamvault/feature/live/presentation/epg/LiveGuideLockPolicy.kt@@ -3,6 +3,9 @@ package com.streamvault.feature.live.presentation.epgimport com.streamvault.domain.model.Categoryimport com.streamvault.domain.model.Channel+fun isLiveGuideCategoryLocked(category: Category, parentalControlLevel: Int): Boolean =+ parentalControlLevel in 1..2 && (category.isAdult || category.isUserProtected)+fun isLiveGuideChannelLocked(channel: Channel,categoriesById: Map<Long, Category>,diff --git a/feature/live/src/test/java/com/streamvault/feature/live/presentation/epg/LiveGuideLockPolicyTest.kt b/feature/live/src/test/java/com/streamvault/feature/live/presentation/epg/LiveGuideLockPolicyTest.ktindex 3445fe3f..9918d3df 100644--- a/feature/live/src/test/java/com/streamvault/feature/live/presentation/epg/LiveGuideLockPolicyTest.kt+++ b/feature/live/src/test/java/com/streamvault/feature/live/presentation/epg/LiveGuideLockPolicyTest.kt@@ -6,6 +6,14 @@ import com.streamvault.domain.model.Channelimport org.junit.Testclass LiveGuideLockPolicyTest {+ @Test+ fun `guide category is locked only when parental controls are active`() {+ val protectedCategory = Category(id = 4L, name = "Protected", isAdult = true)++ assertThat(isLiveGuideCategoryLocked(protectedCategory, parentalControlLevel = 1)).isTrue()+ assertThat(isLiveGuideCategoryLocked(protectedCategory, parentalControlLevel = 0)).isFalse()+ }+@Testfun `guide channel is locked by its own protection or source category`() {val protectedCategory = Category(id = 4L, name = "Protected", isAdult = true)