Bring in from another TV takes its channels when this TV has none on the server
The upstairs TV signed in to the VPS through Settings (not first run), so Join another room wasn't offered and Bring in kept 'channels here as they are': 0 channels. A TV with no channels on this server now brings in the other TV's channels too (lists already matched, collections copy included), and sets them up from those lists without reading the library. A TV with channels keeps its own. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -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() } })
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user