diff --git a/android/app/src/main/java/tv/orbit/classic/Settings.kt b/android/app/src/main/java/tv/orbit/classic/Settings.kt index 6fda0266..001af0fb 100644 --- a/android/app/src/main/java/tv/orbit/classic/Settings.kt +++ b/android/app/src/main/java/tv/orbit/classic/Settings.kt @@ -328,7 +328,7 @@ private fun FamilyDetail(totsOn: Boolean, windingDown: Boolean, onWindDown: (Boo /** Rooms and phones: the phones that can make channels, and (with Multiroom) the other TVs in the home. */ @Composable -private fun RoomsDetail(firstSwitch: FocusRequester, modifier: Modifier, +private fun RoomsDetail(firstSwitch: FocusRequester, modifier: Modifier, hasChannels: Boolean = true, /** * Parks the remote on this section's rail item before a button here is replaced by a panel (10 November 2026): with * the focused button gone, Android gave focus to the first rail item, which opened Channels instead of the panel. @@ -352,8 +352,11 @@ private fun RoomsDetail(firstSwitch: FocusRequester, modifier: Modifier, Box(Modifier.fillMaxSize().background(Navy)) { JoinRoomFlow(onJoined = { RoomArrival.bundle?.let { got -> - runCatching { RoomBundle.applyToWorkspace(Workspaces.current(context).scheduleDir, got, RoomArrival.parts - RoomPart.Channels, sameSchedules = false) } - brought = "Brought in from ${got.optString("room").ifBlank { "the other room" }}." + // A TV with no channels on this server yet takes the other TV's channels too, already matched to the library, + // so it never reads the library itself (1.0 RC3, the upstairs TV joining the VPS); one with channels keeps its own. + val lineup = runCatching { RoomBundle.applyToWorkspace(Workspaces.current(context).scheduleDir, got, if (hasChannels) RoomArrival.parts - RoomPart.Channels else RoomArrival.parts, sameSchedules = false) }.getOrDefault(emptyList()) + if (!hasChannels && lineup.isNotEmpty()) ChannelSetup.begin(SmartChannels.map { it.number }.filter { it in lineup }) + brought = "Brought in from ${got.optString("room").ifBlank { "the other room" }}." + if (!hasChannels && lineup.isNotEmpty()) " Its ${lineup.size} channels are being set up here now, from its own lists." else "" } RoomArrival.done(); bringing = false }, onBack = { RoomArrival.done(); bringing = false }) @@ -396,7 +399,8 @@ private fun RoomsDetail(firstSwitch: FocusRequester, modifier: Modifier, SettingLine(room, "Copied from this TV on ${day.dayOfMonth} ${day.month.getDisplayName(java.time.format.TextStyle.SHORT, java.util.Locale.UK)}. Not linked: it plans its own schedules.") {} } if (RoomLinks.links.isEmpty() && Rooms.joined.isEmpty()) Text("No other TVs yet. Add a TV below to copy this one onto it.", color = Muted, fontSize = 12.sp) - SettingLine("Bring in from another TV", brought ?: "Merge in everyone's profiles and Continue watching from a TV that's already set up. Channels here stay as they are.") { + SettingLine("Bring in from another TV", brought ?: if (hasChannels) "Merge in everyone's profiles and Continue watching from a TV that's already set up. Channels here stay as they are." + else "This TV has no channels on this server yet: bring in another TV's channels, profiles and Continue watching, already matched to the library.") { OrbitButton("Bring in", onClick = { park(); bringing = true }) } Heading("Phones") @@ -633,7 +637,7 @@ internal fun SettingsScreen(section: SettingsSection, onSection: (SettingsSectio LookPicker(first, cardWidth = 128.dp) } SettingsSection.Family -> FamilyDetail(isOn(TOTS_NUMBER), windingDown, onWindDown, firstSwitch, detail) - SettingsSection.Rooms -> RoomsDetail(firstSwitch, detail, park = { runCatching { firstFocus.requestFocus() } }) + SettingsSection.Rooms -> RoomsDetail(firstSwitch, detail, hasChannels = SmartChannels.any { isOn(it.number) }, park = { runCatching { firstFocus.requestFocus() } }) SettingsSection.Account -> AccountDetail(server, titles, onSignOut, onRemoveServer, firstSwitch, detail, park = { runCatching { firstFocus.requestFocus() } }) } }