Placing adds a title to that channel\'s list; it joins as the channel plans ahead, and nothing already booked changes.
';
+ return h + '
Placing adds a title to that channel\'s list; it joins as the channel plans ahead, and nothing already booked changes.
' + later();
}
// Add to home screen (Paul, 6 November 2026): offered once after joining, and any time from More. The TV's page is plain
@@ -684,7 +687,8 @@ async function load(what) {
if (what === 'more') { const [l, c, p] = await Promise.all([api('/api/looks'), api('/api/channels').catch(() => null), api('/api/profiles').catch(() => null)]);
state.looks = l.looks; state.channels = c; state.profiles = p; look(state.now?.look);
if (p?.current?.kind !== 'Kids') api('/api/director').then(r => { state.directorCount = r.ready ? r.ideas.filter(i => i.decision !== 'approved').length + r.choices.length : 0; if (tab === 'more' && !state.create && !state.chair) render(); }).catch(() => {}); }
- if (what === 'director') { const [r, a] = await Promise.all([api('/api/director'), api('/api/arrivals').catch(() => ({arrivals: []}))]); state.director = r; state.arrivals = a.arrivals; }
+ if (what === 'director') { const [r, a, u] = await Promise.all([api('/api/director'), api('/api/arrivals').catch(() => ({arrivals: []})), api('/api/unplayable').catch(() => ({items: []}))]);
+ state.director = r; state.arrivals = a.arrivals; state.unplayable = u.items; }
offline = false;
} catch (e) { if (!offline) toast(e.message === 'Failed to fetch' ? "Orbit isn't open on the TV" : e.message); offline = true; }
// Making a channel isn't redrawn by the background refresh, so typing is never lost.
@@ -780,6 +784,7 @@ document.addEventListener('click', e => {
if (d.kmake) { makeChannel(d.kmake); return; }
if (d.kbrand !== undefined) { const c = state.create; c.draft.name = ($('#kname')?.value || c.draft.name || '').trim(); c.draft.brand = d.kbrand; render(); return; }
if (d.create) { startCreate({name: '', description: '', style: 'Shaped', hours: null, shows: [], skipped: []}); return; }
+ if (d.uretry) { api('/api/unplayable/retry', {id: d.uretry}).then(r => { toast(r.message); state.unplayable = state.unplayable.filter(u => u.id !== d.uretry); render(); }).catch(e => toast(e.message)); return; }
if (d.kaddmore) { const c = state.create; c.quick = false; c.view = 'shows'; c.note = ''; render(); scrollTo(0, 0); return; }
if (d.kdrop) { const dr = state.create.draft; dr.shows = dr.shows.filter(x => x.id !== d.kdrop); dr.core = dr.core.filter(i => i !== d.kdrop); delete dr.slots[d.kdrop]; render(); return; }
if (d.kpower) { const [n, on] = d.kpower.split(':');
diff --git a/android/app/src/main/java/tv/orbit/classic/ChannelScheduler.kt b/android/app/src/main/java/tv/orbit/classic/ChannelScheduler.kt
index 59a04051..1d8379b0 100644
--- a/android/app/src/main/java/tv/orbit/classic/ChannelScheduler.kt
+++ b/android/app/src/main/java/tv/orbit/classic/ChannelScheduler.kt
@@ -248,6 +248,8 @@ internal class ChannelScheduler(private val store: ScheduleStore,
/** A file that wouldn't play. It stays in what's already planned, and is left out from here on. */
fun markFailed(userId: String, itemId: String) {
store.saveFailed(userId, store.loadFailed(userId) + itemId)
+ // Why, for the Chair's "won't play" list.
+ Unplayable.take(itemId)?.let { (title, channel, reason) -> runCatching { store.unplayable().add(itemId, title, channel, reason, clock()) } }
}
/** Starts a channel that has no loop yet: reads its pool, then gives it a small fallback made from that pool. */
diff --git a/android/app/src/main/java/tv/orbit/classic/CreateChannel.kt b/android/app/src/main/java/tv/orbit/classic/CreateChannel.kt
index e8961a66..502dece7 100644
--- a/android/app/src/main/java/tv/orbit/classic/CreateChannel.kt
+++ b/android/app/src/main/java/tv/orbit/classic/CreateChannel.kt
@@ -1,5 +1,7 @@
package tv.orbit.classic
+import org.json.JSONObject
+
import androidx.activity.compose.BackHandler
import androidx.compose.foundation.Canvas
import androidx.compose.foundation.background
@@ -65,6 +67,10 @@ internal class ChannelMaker(
val power: suspend (Int, Boolean) -> String = { _, _ -> "That channel can't be changed here." },
/** Brings back the channel removed a moment ago, as it was. */
val restore: suspend (Int) -> String = { "That channel can't be brought back." },
+ /** Files that won't play here: id, title, channel, why, when. */
+ val unplayable: suspend () -> List = { emptyList() },
+ /** Gives one unplayable file another try: it comes off the list and is planned again. */
+ val retryUnplayable: suspend (String) -> String = { "That can't be done here." },
/** New titles from a channel's collection: added to it, or set aside as seen. */
val arrivals: suspend (Int, List, Boolean) -> String = { _, _, _ -> "That can't be done here." })
diff --git a/android/app/src/main/java/tv/orbit/classic/EmbyClient.kt b/android/app/src/main/java/tv/orbit/classic/EmbyClient.kt
index fcca0763..dec5ed75 100644
--- a/android/app/src/main/java/tv/orbit/classic/EmbyClient.kt
+++ b/android/app/src/main/java/tv/orbit/classic/EmbyClient.kt
@@ -62,9 +62,9 @@ internal class HttpsEmbyTransport(internal val deviceId: String = UUID.randomUUI
}
/** The sign-in headers for this kind of server. */
internal fun authHeaders(token: String?): Map = when (kind) {
- ServerKind.Emby -> mapOf("X-Emby-Authorization" to "Emby Client=\"Orbit TV\", Device=\"Orbit TV\", DeviceId=\"$deviceId\", Version=\"0.108.99\"") +
+ ServerKind.Emby -> mapOf("X-Emby-Authorization" to "Emby Client=\"Orbit TV\", Device=\"Orbit TV\", DeviceId=\"$deviceId\", Version=\"0.108.100\"") +
(token?.let { mapOf("X-Emby-Token" to it) } ?: emptyMap())
- ServerKind.Jellyfin -> mapOf("Authorization" to "MediaBrowser Client=\"Orbit TV\", Device=\"Orbit TV\", DeviceId=\"$deviceId\", Version=\"0.108.99\"" +
+ ServerKind.Jellyfin -> mapOf("Authorization" to "MediaBrowser Client=\"Orbit TV\", Device=\"Orbit TV\", DeviceId=\"$deviceId\", Version=\"0.108.100\"" +
(token?.let { ", Token=\"$it\"" } ?: ""))
}
/** One picture from the provider, or nothing. Same fixed origin and no redirects, and failures are never shown or logged. */
diff --git a/android/app/src/main/java/tv/orbit/classic/EmbyConnectionScreen.kt b/android/app/src/main/java/tv/orbit/classic/EmbyConnectionScreen.kt
index baff3280..60d2e1bf 100644
--- a/android/app/src/main/java/tv/orbit/classic/EmbyConnectionScreen.kt
+++ b/android/app/src/main/java/tv/orbit/classic/EmbyConnectionScreen.kt
@@ -641,6 +641,14 @@ internal fun EmbyConnectionScreen(modifier: Modifier = Modifier, visible: Boolea
SmartChannels.firstOrNull { it.number == number }?.let { setSmartSchedule(it, true) }
"${gone.name} is back on $number."
},
+ unplayable = { withContext(Dispatchers.IO) {
+ val reasons = scheduleStore.unplayable().all()
+ scheduleStore.loadFailed(active.accountId).map { id -> (reasons[id] ?: org.json.JSONObject().put("title", "A file Orbit couldn't play").put("reason", "Noted before Orbit kept reasons.")).put("id", id) }
+ } },
+ retryUnplayable = { id -> withContext(Dispatchers.IO) {
+ scheduleStore.saveFailed(active.accountId, scheduleStore.loadFailed(active.accountId) - id); scheduleStore.unplayable().remove(id)
+ "It'll be tried again as the channel plans ahead. If it still won't play, it comes back here."
+ } },
arrivals = { number, ids, add ->
val ch = CustomChannels.of(number) ?: return@ChannelMaker "That channel has gone."
val seen = ch.seen + ids
diff --git a/android/app/src/main/java/tv/orbit/classic/EmbyPlaybackDialog.kt b/android/app/src/main/java/tv/orbit/classic/EmbyPlaybackDialog.kt
index 233914c0..51f6b7dc 100644
--- a/android/app/src/main/java/tv/orbit/classic/EmbyPlaybackDialog.kt
+++ b/android/app/src/main/java/tv/orbit/classic/EmbyPlaybackDialog.kt
@@ -230,6 +230,8 @@ internal fun EmbyPlaybackDialog(session: EmbySampleSession, plan: EmbyPlaybackPl
return
}
if (scheduled != null) {
+ Unplayable.note(plan.item.id, plan.item.title, scheduled.channel.number,
+ unplayableReason(error.errorCodeName, generateSequence(error.cause) { it.cause }.firstOrNull()?.message?.take(120)))
onUnplayable?.invoke(plan.item.id)
failure = "This programme won't play on this box. Orbit moves on at ${clock(scheduled.programme.endMs)}."
ready = false
@@ -252,6 +254,7 @@ internal fun EmbyPlaybackDialog(session: EmbySampleSession, plan: EmbyPlaybackPl
if (scheduled != null && video.isNotEmpty() && video.none { it.isSupported }) {
android.util.Log.w("OrbitSchedule", "channel=${scheduled.channel.number} noVideoDecoder=${video.first().getTrackFormat(0).sampleMimeType}")
player.stop(); ready = false
+ Unplayable.note(plan.item.id, plan.item.title, scheduled.channel.number, "This TV has no decoder for its picture (${video.first().getTrackFormat(0).sampleMimeType}).")
onUnplayable?.invoke(plan.item.id)
failure = "This programme won't play on this box. Orbit moves on at ${clock(scheduled.programme.endMs)}."
return
diff --git a/android/app/src/main/java/tv/orbit/classic/GuidePicture.kt b/android/app/src/main/java/tv/orbit/classic/GuidePicture.kt
index 724f1a85..6d547e06 100644
--- a/android/app/src/main/java/tv/orbit/classic/GuidePicture.kt
+++ b/android/app/src/main/java/tv/orbit/classic/GuidePicture.kt
@@ -151,6 +151,7 @@ private fun GuideLivePlayer(session: EmbySampleSession, plan: EmbyPlaybackPlan,
val video = tracks.groups.filter { it.type == androidx.media3.common.C.TRACK_TYPE_VIDEO }
if (video.isNotEmpty() && video.none { it.isSupported }) {
android.util.Log.w("OrbitSchedule", "picture channel=$channelNumber noVideoDecoder=${video.first().getTrackFormat(0).sampleMimeType}")
+ Unplayable.note(plan.item.id, plan.item.title, channelNumber, "This TV has no decoder for its picture (${video.first().getTrackFormat(0).sampleMimeType}).")
onCantPlay(plan.item.id)
}
}
diff --git a/android/app/src/main/java/tv/orbit/classic/Idents.kt b/android/app/src/main/java/tv/orbit/classic/Idents.kt
index d3630193..46bcf78b 100644
--- a/android/app/src/main/java/tv/orbit/classic/Idents.kt
+++ b/android/app/src/main/java/tv/orbit/classic/Idents.kt
@@ -39,10 +39,9 @@ private val IdentVideos = mapOf(108 to R.raw.ident_108, 109 to R.raw.ident_109,
/** [atMs] is when the next programme starts, for a channel whose ident follows the time of day. */
/**
- * Idents with a sound of their own (Paul, 7 November 2026; design/channels/sound): played with Ident sound on, at most once
- * every 20 minutes a channel, so a run of short programmes doesn't repeat it every few minutes.
+ * Every channel's ident has a sound of its own (Paul, 7 November 2026; design/channels/sound), played with Ident sound on, at
+ * most once every 20 minutes a channel, so a run of short programmes doesn't repeat it every few minutes. Tots keeps its jingle.
*/
-internal val IdentsWithSound = setOf(R.raw.ident_mistletoe, R.raw.ident_sakura, R.raw.ident_109, R.raw.ident_110)
internal object IdentStings {
private val last = HashMap()
const val GAP_MS = 20 * 60_000L
@@ -133,7 +132,7 @@ internal fun IdentOverlay(session: EmbySampleSession, channel: SampleChannel, ne
seekTo(startedLateMs.coerceIn(0, identMs))
volume = if (block != null) (if (settings.blockIdentSound) 1f else 0f)
else if (mood != null && settings.identSound && TotsJingle.take(mood, System.currentTimeMillis())) 1f
- else if (mood == null && video in IdentsWithSound && settings.identSound && IdentStings.take(channel.number, System.currentTimeMillis())) 1f else 0f
+ else if (mood == null && settings.identSound && IdentStings.take(channel.number, System.currentTimeMillis())) 1f else 0f
prepare(); playWhenReady = true
}
}
diff --git a/android/app/src/main/java/tv/orbit/classic/InstallSnapshot.kt b/android/app/src/main/java/tv/orbit/classic/InstallSnapshot.kt
index c1a11c5e..d55df810 100644
--- a/android/app/src/main/java/tv/orbit/classic/InstallSnapshot.kt
+++ b/android/app/src/main/java/tv/orbit/classic/InstallSnapshot.kt
@@ -38,6 +38,8 @@ internal object InstallSnapshot {
val schedule = File(data, "no_backup/schedule")
schedule.copyRecursively(File(out, "no_backup/schedule"), overwrite = true)
File(data, "shared_prefs/orbit_settings.xml").takeIf { it.exists() }?.copyTo(File(out, "shared_prefs/orbit_settings.xml"), overwrite = true)
+ // Profiles too (7 November 2026), so an install can be shown to keep everyone; names and channels only, no PIN.
+ File(data, "shared_prefs/orbit_profiles.xml").takeIf { it.exists() }?.copyTo(File(out, "shared_prefs/orbit_profiles.xml"), overwrite = true)
File(out, "hashes.txt").writeText(listOf("no_backup/catalogue.db", "no_backup/orbit-connection.v1")
.joinToString("\n") { "${sha256(File(data, it))} $it" } + "\n")
"copied ${schedule.walk().count { it.isFile }}"
diff --git a/android/app/src/main/java/tv/orbit/classic/PhoneLink.kt b/android/app/src/main/java/tv/orbit/classic/PhoneLink.kt
index 3f63eb71..741593c0 100644
--- a/android/app/src/main/java/tv/orbit/classic/PhoneLink.kt
+++ b/android/app/src/main/java/tv/orbit/classic/PhoneLink.kt
@@ -408,6 +408,13 @@ internal object PhoneLink {
val said = runBlocking { withContext(mainDispatcher) { h.maker.restore(number) } }
json(out, 200, JSONObject().put("message", said))
}
+ // Files that won't play, with why (7 November 2026), for the Director's Chair on the phone; Try again takes one off.
+ "GET /api/unplayable" -> json(out, 200, JSONObject().put("items", JSONArray(runBlocking { h.maker.unplayable() }.take(50))))
+ "POST /api/unplayable/retry" -> {
+ if (!OrbitCompanion.grownUp) return json(out, 403, JSONObject().put("error", "Kids is watching. Switch to Adult."))
+ val id = runCatching { JSONObject(r.body).getString("id") }.getOrNull()?.takeIf(EmbyClient::validId) ?: return json(out, 400, JSONObject())
+ json(out, 200, JSONObject().put("message", runBlocking { h.maker.retryUnplayable(id) }))
+ }
// New in a channel's collection since you last looked, for the Director's Chair on the phone.
"GET /api/arrivals" -> {
val cols = runBlocking { h.maker.collections() }.associateBy { it.name }
diff --git a/android/app/src/main/java/tv/orbit/classic/Rooms.kt b/android/app/src/main/java/tv/orbit/classic/Rooms.kt
index dd36c4e9..1042d59a 100644
--- a/android/app/src/main/java/tv/orbit/classic/Rooms.kt
+++ b/android/app/src/main/java/tv/orbit/classic/Rooms.kt
@@ -62,7 +62,7 @@ internal object RoomCrypto {
/** The parts of a set-up that can come across, each ticked on the new box before it's applied. */
internal enum class RoomPart(val title: String, val line: String) {
Channels("Channels and your own channels", "Which channels are on, the channels you've made, and the titles chosen for them"),
- Family("Profiles, Kids and the Adult PIN", "The PIN comes across scrambled, never as its digits"),
+ Family("Profiles, Kids and the Adult PIN", "Everyone's profile, what Orbit has learnt for each, and their Continue watching. The PIN comes across scrambled, never as its digits"),
Look("Look and On screen settings", "The look, subtitles, the cast, motion and the rest"),
Director("Director's Chair decisions", "What you placed, dropped and taught it"),
Arcade("Arcade bests", "High scores and games won")
@@ -77,6 +77,44 @@ private const val BUNDLE_LIMIT = 12 * 1024 * 1024
/** The files that make a room's schedules: plans, progress, the Drive-In's bookings and tickets, and what couldn't play. */
private val ScheduleFiles = Regex("(schedule|progress|booked|tickets|failed)-\\d+\\.json")
+/** Each person's Continue watching, and their Taste files, that travel with Family. */
+private val FamilyFiles = Regex("continue-[A-Za-z0-9]{1,40}\\.json")
+private val TasteFiles = Regex("[A-Za-z0-9_-]{1,40}\\.(events\\.jsonl|state\\.json)")
+
+/** Both rooms' profiles: the same id is the same person (the incoming details win); the result always has a grown-up. */
+internal fun mergedProfiles(here: List, incoming: List): List {
+ val byId = LinkedHashMap(); (here + incoming).forEach { byId[it.id] = it }
+ return byId.values.toList().take(MAX_PROFILES).takeIf { list -> list.any { it.kind == ProfileKind.Grown } } ?: incoming.ifEmpty { here }
+}
+
+/**
+ * Taste and Continue watching from another room, merged into [dir]: Taste events joined by their ids (each counted once, kept in
+ * bounds), a profile's Taste settings kept as they are here when already set, and Continue watching keeping the latest place
+ * for each programme.
+ */
+internal fun mergeFamilyFiles(dir: File, files: JSONObject, nowMs: Long = System.currentTimeMillis()) {
+ files.keys().forEach { name ->
+ val text = files.getString(name)
+ when {
+ name.startsWith("taste/") && name.endsWith(".events.jsonl") && TasteFiles.matches(name.removePrefix("taste/")) -> {
+ val target = File(dir, name).also { it.parentFile?.mkdirs() }
+ val here = if (target.exists()) target.readLines().mapNotNull { TasteEvent.of(it) } else emptyList()
+ val merged = compactTaste(here + text.lines().mapNotNull { TasteEvent.of(it) }, nowMs)
+ target.writeText(merged.joinToString("") { it.toLine() + "\n" })
+ }
+ name.startsWith("taste/") && name.endsWith(".state.json") && TasteFiles.matches(name.removePrefix("taste/")) ->
+ File(dir, name).let { if (!it.exists()) { it.parentFile?.mkdirs(); it.writeText(text) } }
+ FamilyFiles.matches(name) -> {
+ val target = File(dir, name)
+ fun marks(t: String) = runCatching { JSONArray(t).let { a -> (0 until a.length()).mapNotNull { runCatching { ContinueMark.fromJson(a.getJSONObject(it)) }.getOrNull() } } }.getOrDefault(emptyList())
+ val all = (if (target.exists()) marks(target.readText()) else emptyList()) + marks(text)
+ val latest = all.groupBy { it.number to it.startMs }.values.map { same -> same.maxBy { it.atMs } }.sortedByDescending { it.atMs }.take(20)
+ target.writeText(JSONArray(latest.map { it.toJson() }).toString())
+ }
+ }
+ }
+}
+
/** What one box sends another: plain settings and small files, read from the open workspace. Never a password or token. */
internal object RoomBundle {
private fun prefsJson(context: Context, name: String, keys: List?): JSONObject {
@@ -119,7 +157,10 @@ internal object RoomBundle {
// Same schedules as this room, if the new one chooses: the plans, where each channel is up to, and the Drive-In's
// bookings and tickets, copied once, so the same programme is on in both rooms.
.put("schedules", gzip(files(dir, dir.list().orEmpty().filter { ScheduleFiles.matches(it) }.sorted()).toString()))
- .put(RoomPart.Family.name, JSONObject().put("profiles", prefsJson(context, "orbit_profiles", null)).put("lock", prefsJson(context, "orbit_lock", listOf("after_dark_salt", "after_dark_pin"))))
+ .put(RoomPart.Family.name, JSONObject().put("profiles", prefsJson(context, "orbit_profiles", null)).put("lock", prefsJson(context, "orbit_lock", listOf("after_dark_salt", "after_dark_pin")))
+ // Each person's Taste and Continue watching (Rooms sync, 7 November 2026): merged on arrival, never overwriting.
+ .put("people", gzip(files(dir, dir.list().orEmpty().filter { FamilyFiles.matches(it) }.sorted() +
+ File(dir, "taste").list().orEmpty().filter { TasteFiles.matches(it) }.sorted().map { "taste/$it" }).toString())))
.put(RoomPart.Look.name, prefsJson(context, "orbit_settings", LookKeys))
.put(RoomPart.Director.name, files(dir, DirectorFiles))
.put(RoomPart.Arcade.name, prefsJson(context, "orbit_settings", ArcadeKeys))
@@ -130,7 +171,12 @@ internal object RoomBundle {
if (RoomPart.Look in parts) { putPrefs(context, "orbit_settings", bundle.optJSONObject(RoomPart.Look.name), LookKeys); OrbitTheme.load(context) }
if (RoomPart.Arcade in parts) putPrefs(context, "orbit_settings", bundle.optJSONObject(RoomPart.Arcade.name), ArcadeKeys)
if (RoomPart.Family in parts) bundle.optJSONObject(RoomPart.Family.name)?.let { f ->
- putPrefs(context, "orbit_profiles", f.optJSONObject("profiles"), listOf("profiles", "kids_on"))
+ // Everyone from both rooms: the same profile id is the same person, the sender's details winning.
+ val incoming = runCatching { f.getJSONObject("profiles").getJSONObject("profiles").getString("v") }.getOrNull()
+ val here = context.getSharedPreferences("orbit_profiles", Context.MODE_PRIVATE).getString("profiles", null)
+ putPrefs(context, "orbit_profiles", f.optJSONObject("profiles"), listOf("kids_on"))
+ if (incoming != null) runCatching { mergedProfiles(here?.let { Profiles.decode(it) }.orEmpty(), Profiles.decode(incoming)) }.getOrNull()?.let { merged ->
+ context.getSharedPreferences("orbit_profiles", Context.MODE_PRIVATE).edit().putString("profiles", Profiles.encode(merged)).apply() }
putPrefs(context, "orbit_lock", f.optJSONObject("lock"), listOf("after_dark_salt", "after_dark_pin"))
AfterDarkLock.load(context); Profiles.load(context)
}
@@ -150,6 +196,8 @@ internal object RoomBundle {
lineup = c.optJSONArray("lineup")?.let { a -> (0 until minOf(a.length(), 200)).map { a.getInt(it) } }.orEmpty()
}
if (RoomPart.Director in parts) write(bundle.optJSONObject(RoomPart.Director.name))
+ if (RoomPart.Family in parts) bundle.optJSONObject(RoomPart.Family.name)?.optString("people")?.takeIf { it.isNotBlank() }?.let { packed ->
+ runCatching { mergeFamilyFiles(dir, JSONObject(gunzip(packed))) } }
// Only with the channels: a schedule is for a channel that's on. Never over a schedule this box already has.
if (sameSchedules && RoomPart.Channels in parts) bundle.optString("schedules").takeIf { it.isNotBlank() }?.let { packed ->
runCatching { JSONObject(gunzip(packed)).let { files -> files.keys().forEach { n ->
diff --git a/android/app/src/main/java/tv/orbit/classic/ScheduleStore.kt b/android/app/src/main/java/tv/orbit/classic/ScheduleStore.kt
index 3631fea4..1747134f 100644
--- a/android/app/src/main/java/tv/orbit/classic/ScheduleStore.kt
+++ b/android/app/src/main/java/tv/orbit/classic/ScheduleStore.kt
@@ -166,6 +166,7 @@ internal class ScheduleStore(private val directory: File) {
}
/** Files that wouldn't play on this box, across every channel. Never planned again. */
+ fun unplayable() = UnplayableLog(File(directory, "failed-reasons-0.json"))
fun saveFailed(userId: String, ids: Set) =
write(file("failed", 0), root(userId, 0).put("items", JSONArray(ids.toList())))
/**
diff --git a/android/app/src/main/java/tv/orbit/classic/SecureMediaDataSource.kt b/android/app/src/main/java/tv/orbit/classic/SecureMediaDataSource.kt
index ca962e22..54905c54 100644
--- a/android/app/src/main/java/tv/orbit/classic/SecureMediaDataSource.kt
+++ b/android/app/src/main/java/tv/orbit/classic/SecureMediaDataSource.kt
@@ -39,7 +39,7 @@ internal class SecureMediaDataSource(private val session: EmbySampleSession) : B
next.instanceFollowRedirects = false
next.connectTimeout = 10_000
next.readTimeout = 20_000
- next.setRequestProperty("User-Agent", "OrbitTV/0.108.99")
+ next.setRequestProperty("User-Agent", "OrbitTV/0.108.100")
next.setRequestProperty("Accept-Encoding", "identity")
session.mediaHeaders(address).forEach { (key, value) -> next.setRequestProperty(key, value) }
if (dataSpec.position != 0L || dataSpec.length != C.LENGTH_UNSET.toLong()) {
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 289b2d72..13c7857e 100644
--- a/android/app/src/main/java/tv/orbit/classic/Settings.kt
+++ b/android/app/src/main/java/tv/orbit/classic/Settings.kt
@@ -35,6 +35,8 @@ import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
+import androidx.compose.ui.window.Dialog
+import androidx.compose.ui.window.DialogProperties
import androidx.tv.material3.Text
import kotlinx.coroutines.launch
@@ -279,7 +281,7 @@ private fun ViewingDetail(firstSwitch: FocusRequester, modifier: Modifier, top:
SettingLine("Idents", "Play each channel's ident between programmes. When off, Tots shows a still picture instead.") {
OnOff(idents, Modifier, onClick = { idents = !idents; settings.idents = idents })
}
- SettingLine("Ident sound", "Let Tots play its jingle, and channels with a sound of their own (Mistletoe, Sakura, Signature, Unscripted) play theirs, never too often.") {
+ SettingLine("Ident sound", "Each channel's ident plays its own short sound, at most every 20 minutes a channel; Tots plays its jingle.") {
OnOff(identSound, Modifier, onClick = { identSound = !identSound; settings.identSound = identSound })
}
SettingLine("Special idents", "Give named blocks and events their own ident as they begin, such as Riot Laughs or PPV Sunday. Off uses each channel's usual ident.") {
@@ -350,7 +352,25 @@ private fun RoomsDetail(firstSwitch: FocusRequester, modifier: Modifier) {
var adding by remember { mutableStateOf(false) }
var naming by remember { mutableStateOf(false) }
var connecting by remember { mutableStateOf(false) }
+ var bringing by remember { mutableStateOf(false) }
+ var brought by remember { mutableStateOf(null) }
if (adding) { AddRoomPanel(onClose = { adding = false }, modifier = modifier); return }
+ // Rooms sync (Paul, 7 November 2026): a TV already set up can bring in another room's family, Taste and Continue watching.
+ // What's ticked is merged: people join, events join by id, nothing here is overwritten, and no schedule or channel changes.
+ if (bringing) {
+ Dialog(onDismissRequest = { bringing = false }, properties = DialogProperties(usePlatformDefaultWidth = false)) {
+ 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" }}."
+ }
+ RoomArrival.done(); bringing = false
+ }, onBack = { RoomArrival.done(); bringing = false })
+ }
+ }
+ return
+ }
if (connecting) {
// Orbit Companion (Paul, 6 November 2026): the same one-time code as Create your own's, from where phones are listed.
BackHandler { connecting = false }
@@ -372,6 +392,9 @@ private fun RoomsDetail(firstSwitch: FocusRequester, modifier: Modifier) {
listOf("Living Room", "Lounge", "Bedroom", "Kids' room", "Kitchen", "Den").forEach { n -> OrbitButton(n, selected = n == Rooms.name, onClick = { Rooms.rename(context, n); naming = false }) }
}
Heading("Other rooms")
+ SettingLine("Bring in from another room", brought ?: "Everyone's profiles, what Orbit has learnt for each, and their Continue watching, merged in from a TV that's already set up. Channels and schedules here stay as they are.") {
+ OrbitButton("Bring in", onClick = { bringing = true })
+ }
SettingLine("Add a room", "Set up Orbit on another TV in your home by copying this one: channels, profiles, look and more. Your password never travels.") {
OrbitButton("Add a room", onClick = { adding = true })
}
diff --git a/android/app/src/main/java/tv/orbit/classic/Unplayable.kt b/android/app/src/main/java/tv/orbit/classic/Unplayable.kt
new file mode 100644
index 00000000..c9617a13
--- /dev/null
+++ b/android/app/src/main/java/tv/orbit/classic/Unplayable.kt
@@ -0,0 +1,41 @@
+package tv.orbit.classic
+
+import org.json.JSONObject
+import java.io.File
+
+/**
+ * Files that won't play, with why (Paul, 7 November 2026: The Twilight Zone S1 E3 failed and nobody knew). The player notes the
+ * reason as it gives up on a file; the list beside the failed list keeps it, with the title and channel, so the phone's Director's
+ * Chair can show each one and offer Try again. Only names, channels and the player's own error kinds are kept.
+ */
+internal object Unplayable {
+ private val pending = HashMap>()
+ /** Noted by the player just before it reports [itemId] as unplayable. */
+ @Synchronized fun note(itemId: String, title: String, channel: Int?, reason: String) { pending[itemId] = Triple(title, channel, reason) }
+ @Synchronized fun take(itemId: String) = pending.remove(itemId)
+}
+
+/** The player's error kind, in a sentence someone can act on. */
+internal fun unplayableReason(errorCodeName: String?, detail: String? = null): String = when {
+ errorCodeName == null && detail != null -> detail
+ errorCodeName == null -> "It stopped without saying why."
+ "PARSING" in errorCodeName -> "The file's structure couldn't be read (${detail ?: errorCodeName})."
+ "DECODER" in errorCodeName || "DECODING" in errorCodeName -> "This TV can't decode its picture or sound."
+ "IO_" in errorCodeName -> "The file couldn't be fetched from the server."
+ "AUDIO_TRACK" in errorCodeName -> "Its sound couldn't be played on this TV."
+ else -> "The player stopped ($errorCodeName)."
+}
+
+/** The reasons file: one entry per failed item, `{title, channel, reason, at}`. */
+internal class UnplayableLog(private val file: File) {
+ @Synchronized fun all(): Map = runCatching { JSONObject(file.readText()).let { o -> o.keys().asSequence().associateWith { o.getJSONObject(it) } } }.getOrDefault(emptyMap())
+ @Synchronized fun add(itemId: String, title: String, channel: Int?, reason: String, nowMs: Long) {
+ val o = runCatching { JSONObject(file.readText()) }.getOrDefault(JSONObject())
+ o.put(itemId, JSONObject().put("title", title.take(160)).put("channel", channel ?: JSONObject.NULL).put("reason", reason.take(240)).put("at", nowMs))
+ file.writeText(o.toString())
+ }
+ @Synchronized fun remove(itemId: String) {
+ val o = runCatching { JSONObject(file.readText()) }.getOrNull() ?: return
+ o.remove(itemId); file.writeText(o.toString())
+ }
+}
diff --git a/android/app/src/main/res/raw/ident_101.mp4 b/android/app/src/main/res/raw/ident_101.mp4
index 164b63e0..991cd071 100644
Binary files a/android/app/src/main/res/raw/ident_101.mp4 and b/android/app/src/main/res/raw/ident_101.mp4 differ
diff --git a/android/app/src/main/res/raw/ident_102.mp4 b/android/app/src/main/res/raw/ident_102.mp4
index 66395876..058bc77d 100644
Binary files a/android/app/src/main/res/raw/ident_102.mp4 and b/android/app/src/main/res/raw/ident_102.mp4 differ
diff --git a/android/app/src/main/res/raw/ident_103.mp4 b/android/app/src/main/res/raw/ident_103.mp4
index bf0c8e34..6a79c782 100644
Binary files a/android/app/src/main/res/raw/ident_103.mp4 and b/android/app/src/main/res/raw/ident_103.mp4 differ
diff --git a/android/app/src/main/res/raw/ident_104.mp4 b/android/app/src/main/res/raw/ident_104.mp4
index b34f79e2..ac0c3d10 100644
Binary files a/android/app/src/main/res/raw/ident_104.mp4 and b/android/app/src/main/res/raw/ident_104.mp4 differ
diff --git a/android/app/src/main/res/raw/ident_105.mp4 b/android/app/src/main/res/raw/ident_105.mp4
index b3a7c092..50478ab7 100644
Binary files a/android/app/src/main/res/raw/ident_105.mp4 and b/android/app/src/main/res/raw/ident_105.mp4 differ
diff --git a/android/app/src/main/res/raw/ident_106.mp4 b/android/app/src/main/res/raw/ident_106.mp4
index 591c6af7..2e62a88c 100644
Binary files a/android/app/src/main/res/raw/ident_106.mp4 and b/android/app/src/main/res/raw/ident_106.mp4 differ
diff --git a/android/app/src/main/res/raw/ident_107.mp4 b/android/app/src/main/res/raw/ident_107.mp4
index cdd9d9da..7ff871dd 100644
Binary files a/android/app/src/main/res/raw/ident_107.mp4 and b/android/app/src/main/res/raw/ident_107.mp4 differ
diff --git a/android/app/src/main/res/raw/ident_108.mp4 b/android/app/src/main/res/raw/ident_108.mp4
index ed33b6da..3c4433c4 100644
Binary files a/android/app/src/main/res/raw/ident_108.mp4 and b/android/app/src/main/res/raw/ident_108.mp4 differ
diff --git a/android/app/src/main/res/raw/ident_201.mp4 b/android/app/src/main/res/raw/ident_201.mp4
index 69a8fd53..10da3689 100644
Binary files a/android/app/src/main/res/raw/ident_201.mp4 and b/android/app/src/main/res/raw/ident_201.mp4 differ
diff --git a/android/app/src/main/res/raw/ident_202.mp4 b/android/app/src/main/res/raw/ident_202.mp4
index 3cc99d40..ddea2367 100644
Binary files a/android/app/src/main/res/raw/ident_202.mp4 and b/android/app/src/main/res/raw/ident_202.mp4 differ
diff --git a/android/app/src/main/res/raw/ident_203.mp4 b/android/app/src/main/res/raw/ident_203.mp4
index d37dec2d..0222f52c 100644
Binary files a/android/app/src/main/res/raw/ident_203.mp4 and b/android/app/src/main/res/raw/ident_203.mp4 differ
diff --git a/android/app/src/main/res/raw/ident_204.mp4 b/android/app/src/main/res/raw/ident_204.mp4
index f6d6fd3e..04a2c388 100644
Binary files a/android/app/src/main/res/raw/ident_204.mp4 and b/android/app/src/main/res/raw/ident_204.mp4 differ
diff --git a/android/app/src/main/res/raw/ident_205.mp4 b/android/app/src/main/res/raw/ident_205.mp4
index 831e75a3..95f37911 100644
Binary files a/android/app/src/main/res/raw/ident_205.mp4 and b/android/app/src/main/res/raw/ident_205.mp4 differ
diff --git a/android/app/src/main/res/raw/ident_206.mp4 b/android/app/src/main/res/raw/ident_206.mp4
index a84e7863..cfc016b3 100644
Binary files a/android/app/src/main/res/raw/ident_206.mp4 and b/android/app/src/main/res/raw/ident_206.mp4 differ
diff --git a/android/app/src/main/res/raw/ident_301.mp4 b/android/app/src/main/res/raw/ident_301.mp4
index 828bcd25..f95e884f 100644
Binary files a/android/app/src/main/res/raw/ident_301.mp4 and b/android/app/src/main/res/raw/ident_301.mp4 differ
diff --git a/android/app/src/main/res/raw/ident_302.mp4 b/android/app/src/main/res/raw/ident_302.mp4
index b2dd8a87..70c0f2f1 100644
Binary files a/android/app/src/main/res/raw/ident_302.mp4 and b/android/app/src/main/res/raw/ident_302.mp4 differ
diff --git a/android/app/src/main/res/raw/ident_303.mp4 b/android/app/src/main/res/raw/ident_303.mp4
index 739894f4..417a68c1 100644
Binary files a/android/app/src/main/res/raw/ident_303.mp4 and b/android/app/src/main/res/raw/ident_303.mp4 differ
diff --git a/android/app/src/main/res/raw/ident_304.mp4 b/android/app/src/main/res/raw/ident_304.mp4
index d884d296..d1817e7a 100644
Binary files a/android/app/src/main/res/raw/ident_304.mp4 and b/android/app/src/main/res/raw/ident_304.mp4 differ
diff --git a/android/app/src/main/res/raw/ident_305.mp4 b/android/app/src/main/res/raw/ident_305.mp4
index 9eac1209..4adf817d 100644
Binary files a/android/app/src/main/res/raw/ident_305.mp4 and b/android/app/src/main/res/raw/ident_305.mp4 differ
diff --git a/android/app/src/main/res/raw/ident_306.mp4 b/android/app/src/main/res/raw/ident_306.mp4
index 13eb13a0..7dea0d28 100644
Binary files a/android/app/src/main/res/raw/ident_306.mp4 and b/android/app/src/main/res/raw/ident_306.mp4 differ
diff --git a/android/app/src/main/res/raw/ident_307.mp4 b/android/app/src/main/res/raw/ident_307.mp4
index 1e258747..b1a82586 100644
Binary files a/android/app/src/main/res/raw/ident_307.mp4 and b/android/app/src/main/res/raw/ident_307.mp4 differ
diff --git a/android/app/src/main/res/raw/ident_308.mp4 b/android/app/src/main/res/raw/ident_308.mp4
index 550e5c02..263398fb 100644
Binary files a/android/app/src/main/res/raw/ident_308.mp4 and b/android/app/src/main/res/raw/ident_308.mp4 differ
diff --git a/android/app/src/main/res/raw/ident_309.mp4 b/android/app/src/main/res/raw/ident_309.mp4
index e0b3ee49..4827b6e4 100644
Binary files a/android/app/src/main/res/raw/ident_309.mp4 and b/android/app/src/main/res/raw/ident_309.mp4 differ
diff --git a/android/app/src/main/res/raw/ident_310.mp4 b/android/app/src/main/res/raw/ident_310.mp4
index 34a8d0de..fc4c3235 100644
Binary files a/android/app/src/main/res/raw/ident_310.mp4 and b/android/app/src/main/res/raw/ident_310.mp4 differ
diff --git a/android/app/src/main/res/raw/ident_401.mp4 b/android/app/src/main/res/raw/ident_401.mp4
index d3985adf..cb09cb42 100644
Binary files a/android/app/src/main/res/raw/ident_401.mp4 and b/android/app/src/main/res/raw/ident_401.mp4 differ
diff --git a/android/app/src/main/res/raw/ident_601.mp4 b/android/app/src/main/res/raw/ident_601.mp4
index e7f42a82..4503398a 100644
Binary files a/android/app/src/main/res/raw/ident_601.mp4 and b/android/app/src/main/res/raw/ident_601.mp4 differ
diff --git a/android/app/src/main/res/raw/ident_602.mp4 b/android/app/src/main/res/raw/ident_602.mp4
index 129b3316..553f406c 100644
Binary files a/android/app/src/main/res/raw/ident_602.mp4 and b/android/app/src/main/res/raw/ident_602.mp4 differ
diff --git a/android/app/src/main/res/raw/ident_603.mp4 b/android/app/src/main/res/raw/ident_603.mp4
index 9b62a06a..51641f48 100644
Binary files a/android/app/src/main/res/raw/ident_603.mp4 and b/android/app/src/main/res/raw/ident_603.mp4 differ
diff --git a/android/app/src/main/res/raw/ident_604.mp4 b/android/app/src/main/res/raw/ident_604.mp4
index ab1726b1..47ae90e3 100644
Binary files a/android/app/src/main/res/raw/ident_604.mp4 and b/android/app/src/main/res/raw/ident_604.mp4 differ
diff --git a/android/app/src/main/res/raw/ident_605.mp4 b/android/app/src/main/res/raw/ident_605.mp4
index 30e233cf..e3e8fb2b 100644
Binary files a/android/app/src/main/res/raw/ident_605.mp4 and b/android/app/src/main/res/raw/ident_605.mp4 differ
diff --git a/android/app/src/main/res/raw/ident_611.mp4 b/android/app/src/main/res/raw/ident_611.mp4
index 27a0623f..fa1b15fb 100644
Binary files a/android/app/src/main/res/raw/ident_611.mp4 and b/android/app/src/main/res/raw/ident_611.mp4 differ
diff --git a/android/app/src/main/res/raw/ident_612.mp4 b/android/app/src/main/res/raw/ident_612.mp4
index 8aa3efe5..9baafbf7 100644
Binary files a/android/app/src/main/res/raw/ident_612.mp4 and b/android/app/src/main/res/raw/ident_612.mp4 differ
diff --git a/android/app/src/main/res/raw/ident_613.mp4 b/android/app/src/main/res/raw/ident_613.mp4
index 00edaec4..99c6b6d2 100644
Binary files a/android/app/src/main/res/raw/ident_613.mp4 and b/android/app/src/main/res/raw/ident_613.mp4 differ
diff --git a/android/app/src/test/java/tv/orbit/classic/RoomsFamilyTest.kt b/android/app/src/test/java/tv/orbit/classic/RoomsFamilyTest.kt
new file mode 100644
index 00000000..a913e2d2
--- /dev/null
+++ b/android/app/src/test/java/tv/orbit/classic/RoomsFamilyTest.kt
@@ -0,0 +1,54 @@
+package tv.orbit.classic
+
+import org.json.JSONArray
+import org.json.JSONObject
+import org.junit.Assert.*
+import org.junit.Rule
+import org.junit.Test
+import org.junit.rules.TemporaryFolder
+
+/** Rooms sync (7 November 2026): profiles, Taste and Continue watching merge between rooms, never overwriting or doubling. */
+class RoomsFamilyTest {
+ @get:Rule val tmp = TemporaryFolder()
+
+ @Test fun profilesFromBothRoomsJoin() {
+ val wife = Profile("pwife01", "Wife", "sil-pink", ProfileKind.Grown)
+ val renamed = DefaultProfiles.first().copy(name = "Paul")
+ val merged = mergedProfiles(DefaultProfiles, listOf(renamed, DefaultProfiles[1], wife))
+ assertEquals(listOf("grown", "kids", "pwife01"), merged.map { it.id })
+ assertEquals("Paul", merged.first().name)
+ }
+
+ @Test fun tasteAndContinueWatchingMergeByIdAndLatest() {
+ val dir = tmp.newFolder("schedule")
+ val now = 1_794_000_000_000L
+ fun ev(id: String, item: String, at: Long) = TasteEvent(id, "grown", TasteKind.Chose, item, null, "T", 106, at, null, "test")
+ java.io.File(dir, "taste").mkdirs()
+ java.io.File(dir, "taste/grown.events.jsonl").writeText(ev("a", "1001", now - 5_000).toLine() + "\n")
+ java.io.File(dir, "taste/grown.state.json").writeText(TasteState(false).toJson().toString())
+ java.io.File(dir, "continue-grown.json").writeText(JSONArray(listOf(ContinueMark(106, 10, "1001", 60_000, 2_700_000, now - 9_000).toJson())).toString())
+ val incoming = JSONObject()
+ .put("taste/grown.events.jsonl", ev("a", "1001", now - 5_000).toLine() + "\n" + ev("b", "1002", now - 1_000).toLine() + "\n")
+ .put("taste/grown.state.json", TasteState(true).toJson().toString())
+ .put("taste/pwife01.events.jsonl", TasteEvent("c", "pwife01", TasteKind.Saved, "2001", null, "W", 205, now, null, "test").toLine() + "\n")
+ .put("continue-grown.json", JSONArray(listOf(ContinueMark(106, 10, "1001", 900_000, 2_700_000, now - 1_000).toJson())).toString())
+ .put("../evil.json", "x")
+ mergeFamilyFiles(dir, incoming, now)
+ val events = java.io.File(dir, "taste/grown.events.jsonl").readLines().mapNotNull { TasteEvent.of(it) }
+ assertEquals(listOf("a", "b"), events.map { it.id })
+ assertFalse("this room's own Personalise choice stays", JSONObject(java.io.File(dir, "taste/grown.state.json").readText()).getBoolean("personalise"))
+ assertTrue(java.io.File(dir, "taste/pwife01.events.jsonl").exists())
+ val marks = JSONArray(java.io.File(dir, "continue-grown.json").readText())
+ assertEquals(1, marks.length()); assertEquals(900_000L, marks.getJSONObject(0).getLong("p"))
+ assertFalse(java.io.File(tmp.root, "evil.json").exists())
+ }
+
+ @Test fun unplayableReasonsReadPlainly() {
+ assertTrue(unplayableReason("ERROR_CODE_PARSING_CONTAINER_MALFORMED", "ContentCompAlgo 0").startsWith("The file's structure"))
+ assertEquals("This TV can't decode its picture or sound.", unplayableReason("ERROR_CODE_DECODER_INIT_FAILED"))
+ val log = UnplayableLog(java.io.File(tmp.root, "failed-reasons-0.json"))
+ log.add("7542928", "The Twilight Zone / S1 E3", 106, "x", 1); log.add("1", "Other", null, "y", 2)
+ log.remove("1")
+ assertEquals(setOf("7542928"), log.all().keys)
+ }
+}