diff --git a/android/app/build.gradle.kts b/android/app/build.gradle.kts
index 4c615781..ada23649 100644
--- a/android/app/build.gradle.kts
+++ b/android/app/build.gradle.kts
@@ -9,8 +9,8 @@ android {
applicationId = "tv.orbit.classic"
minSdk = 26
targetSdk = 36
- versionCode = 263
- versionName = "0.108.103-sync-not-self"
+ versionCode = 264
+ versionName = "0.108.104-morning-fixes"
}
buildFeatures { compose = true }
// The finished build for the TVs (Paul, 6 November 2026: the test build stuttered on the box). Not debuggable, so
diff --git a/android/app/src/main/assets/phone/companion.html b/android/app/src/main/assets/phone/companion.html
index 555da794..56133810 100644
--- a/android/app/src/main/assets/phone/companion.html
+++ b/android/app/src/main/assets/phone/companion.html
@@ -157,7 +157,9 @@ function nowCard() {
}
function remote() {
const q = state.now?.queue || [];
- return head('Remote') + nowCard() + (q.length ? `
Then from your queue: ${esc(q[0].title)}${q.length > 1 ? ` +${q.length - 1} more` : ''}
` : '') + `
+ // Orbit in the background on the TV (another app on screen): connected, but say so rather than seem broken.
+ const away = state.now && state.now.onTv === false ? `
Orbit isn't on screen on ${esc(room())}. Another app is showing. Open Orbit on the TV and the remote works again.
Then from your queue: ${esc(q[0].title)}${q.length > 1 ? ` +${q.length - 1} more` : ''}
` : '') + `
@@ -858,6 +860,9 @@ document.addEventListener('click', e => {
offerHome(); render(); (keptLook() || tab === 'more' ? load('more') : Promise.resolve()).then(() => load('now')); if (tab !== 'remote' && tab !== 'more') load(tab);
// Kept fresh while the phone is looking: what's on every 15 seconds, and the open list every minute.
setInterval(() => { if (!document.hidden) load('now'); }, 15000);
+// When the TV couldn't be reached, try again every few seconds, so the web app reconnects by itself (8 November 2026).
+setInterval(() => { if (!document.hidden && offline) load('now'); }, 4000);
+document.addEventListener('visibilitychange', () => { if (!document.hidden) load('now'); });
setInterval(() => { if (!document.hidden && ['guide','catchup','rooms'].includes(tab)) load(tab); }, 60000);
document.addEventListener('visibilitychange', () => { if (!document.hidden) load('now'); });
diff --git a/android/app/src/main/java/tv/orbit/classic/CatchUp.kt b/android/app/src/main/java/tv/orbit/classic/CatchUp.kt
index 8d2e6c02..6ad0a698 100644
--- a/android/app/src/main/java/tv/orbit/classic/CatchUp.kt
+++ b/android/app/src/main/java/tv/orbit/classic/CatchUp.kt
@@ -151,7 +151,8 @@ internal fun catchUpMatches(entry: CatchUpEntry, channel: Int?, query: String):
internal fun CatchUpScreen(channels: List, session: EmbySampleSession?, modifier: Modifier = Modifier, onOpen: (CatchUpEntry) -> Unit,
onResume: (ContinueEntry) -> Unit = {}) {
var now by remember { mutableLongStateOf(System.currentTimeMillis()) }
- LaunchedEffect(Unit) { while (true) { delay(30_000); if (!FullScreen.active) now = System.currentTimeMillis() } }
+ val fullScreen = FullScreen.active
+ LaunchedEffect(fullScreen) { if (!fullScreen) now = System.currentTimeMillis(); while (true) { delay(30_000); if (!FullScreen.active) now = System.currentTimeMillis() } }
var channelFilter by remember { mutableStateOf(null) }
var query by remember { mutableStateOf("") }
var searching by remember { mutableStateOf(false) }
diff --git a/android/app/src/main/java/tv/orbit/classic/ContinueWatching.kt b/android/app/src/main/java/tv/orbit/classic/ContinueWatching.kt
index 445e6e8a..a548bdab 100644
--- a/android/app/src/main/java/tv/orbit/classic/ContinueWatching.kt
+++ b/android/app/src/main/java/tv/orbit/classic/ContinueWatching.kt
@@ -8,7 +8,8 @@ import org.json.JSONObject
import java.io.File
/**
- * Continue watching (Paul, 7 November 2026): where you left a programme part-way, from Catch Up or live, so Catch Up can
+ * Continue watching (Paul, 7 November 2026): where you left a programme part-way in Catch Up (live viewing isn't counted, since
+ * 8 November 2026), so Catch Up can
* carry it on from there while it's still in Catch Up. One list per profile, on this box only. It only reads the plans.
*/
internal class ContinueMark(val number: Int, val startMs: Long, val itemId: String, val positionMs: Long, val durationMs: Long, val atMs: Long) {
@@ -63,6 +64,12 @@ internal object ContinueWatching {
private var file: File? = null
fun load(scheduleDir: File, profile: String?) {
+ // Once: the lists made while live viewing counted too are set aside, now that only Catch Up adds to them.
+ val flag = File(scheduleDir, "continue-catchup-only")
+ if (!flag.exists()) runCatching {
+ scheduleDir.listFiles { f -> Regex("continue-[A-Za-z0-9]{1,40}\\.json").matches(f.name) }?.forEach { it.renameTo(File(scheduleDir, it.name + ".before-catchup-only")) }
+ flag.writeText("")
+ }
file = File(scheduleDir, "continue-${(profile ?: "all").filter { it.isLetterOrDigit() }.take(40)}.json")
marks = runCatching { JSONArray(file!!.readText()).let { a -> (0 until minOf(a.length(), CONTINUE_MAX)).mapNotNull { runCatching { ContinueMark.fromJson(a.getJSONObject(it)) }.getOrNull() } } }.getOrDefault(emptyList())
}
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 993747d2..2ca0366b 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.103\"") +
+ ServerKind.Emby -> mapOf("X-Emby-Authorization" to "Emby Client=\"Orbit TV\", Device=\"Orbit TV\", DeviceId=\"$deviceId\", Version=\"0.108.104\"") +
(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.103\"" +
+ ServerKind.Jellyfin -> mapOf("Authorization" to "MediaBrowser Client=\"Orbit TV\", Device=\"Orbit TV\", DeviceId=\"$deviceId\", Version=\"0.108.104\"" +
(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 6762a46f..660f935c 100644
--- a/android/app/src/main/java/tv/orbit/classic/EmbyConnectionScreen.kt
+++ b/android/app/src/main/java/tv/orbit/classic/EmbyConnectionScreen.kt
@@ -327,7 +327,8 @@ internal fun EmbyConnectionScreen(modifier: Modifier = Modifier, visible: Boolea
catch (_: Exception) { message = "Connected, but this setup could not be saved securely. It will need sign-in after restart." }
}
}
- LaunchedEffect(Unit) { while (true) { delay(1000); if (!FullScreen.active) now = System.currentTimeMillis() } }
+ val fullScreen = FullScreen.active
+ LaunchedEffect(fullScreen) { if (!fullScreen) now = System.currentTimeMillis(); while (true) { delay(1000); if (!FullScreen.active) now = System.currentTimeMillis() } }
LaunchedEffect(scheduledChannels) { windingDown = scheduledChannels[TOTS_NUMBER]?.stepIn?.let { it.endMs > System.currentTimeMillis() } == true }
fun smartLoop(programming: ChannelProgramming) = (extraChannels + listOfNotNull(channel, afterDarkChannel, toonamiChannel)).firstOrNull { it.number == programming.number }
LaunchedEffect(session != null) { if (session != null) onSignedIn() }
@@ -380,7 +381,8 @@ internal fun EmbyConnectionScreen(modifier: Modifier = Modifier, visible: Boolea
val now = System.currentTimeMillis(); val at = now + channelClockOffset
val show = runCatching { channel.at(at) }.getOrNull() ?: continue
if (show.endMs - show.startMs < 10 * 60_000L) continue
- runCatching { withContext(Dispatchers.IO) { ContinueWatching.note(channel.number, show, at - show.startMs, now) } }
+ // Continue watching is for Catch Up only (Paul, 8 November 2026): what you watch live isn't added to it.
+ if (channelClockOffset < 0) runCatching { withContext(Dispatchers.IO) { ContinueWatching.note(channel.number, show, at - show.startMs, now) } }
runCatching { withContext(Dispatchers.IO) { Taste.watching(channel.number, show, channel.seriesIdAt(show.startMs), at - show.startMs, now) } }
}
}
diff --git a/android/app/src/main/java/tv/orbit/classic/MainActivity.kt b/android/app/src/main/java/tv/orbit/classic/MainActivity.kt
index 2675fa6d..dc2069d2 100644
--- a/android/app/src/main/java/tv/orbit/classic/MainActivity.kt
+++ b/android/app/src/main/java/tv/orbit/classic/MainActivity.kt
@@ -46,7 +46,7 @@ internal fun clock(time: Long) = SimpleDateFormat("HH:mm", Locale.UK).format(Dat
class MainActivity : ComponentActivity() {
override fun onStart() {
- super.onStart(); if (PhoneLink.phones.isNotEmpty()) PhoneLink.start()
+ super.onStart(); OrbitCompanion.onTv = true; if (PhoneLink.phones.isNotEmpty()) PhoneLink.start()
// Multiroom auto-scan: a set-up Orbit can be found by a new TV while it's open.
if (Onboarding.done(this)) {
RoomBeacon.on(this)
@@ -54,7 +54,9 @@ class MainActivity : ComponentActivity() {
lifecycleScope.launch { runCatching { RoomUpdates.look(this@MainActivity) } }
}
}
- override fun onStop() { RoomBeacon.off(this); PhoneLink.offerRoom(null); PhoneLink.stop(); super.onStop() }
+ // Phones stay connected while Orbit is in the background (Paul, 8 November 2026: the web app couldn't connect while the TV
+ // was in another app), and paired rooms keep syncing; the phone says Orbit isn't on screen instead of failing to load.
+ override fun onStop() { OrbitCompanion.onTv = false; PhoneLink.offerRoom(null); if (PhoneLink.phones.isEmpty() && RoomLinks.links.none { it.on }) { RoomBeacon.off(this); PhoneLink.stop() }; super.onStop() }
override fun onCreate(savedInstanceState: Bundle?) {
OrbitCompanion.activity = java.lang.ref.WeakReference(this)
super.onCreate(savedInstanceState)
diff --git a/android/app/src/main/java/tv/orbit/classic/OrbitCompanion.kt b/android/app/src/main/java/tv/orbit/classic/OrbitCompanion.kt
index ecf2fd40..0779969d 100644
--- a/android/app/src/main/java/tv/orbit/classic/OrbitCompanion.kt
+++ b/android/app/src/main/java/tv/orbit/classic/OrbitCompanion.kt
@@ -122,6 +122,8 @@ internal object OrbitCompanion {
private fun channelJson(c: SampleChannel) = JSONObject().put("number", c.number).put("name", ChannelBrands.forNumber(c.number)?.displayName ?: c.name)
/** What the TV is on: the chosen channel, what it's showing at the TV's clock, and what's next. */
+ /** Orbit is on the TV's screen; false while the TV shows another app (phones and paired rooms still connect). */
+ @Volatile var onTv = true
fun now(screen: CompanionScreen, nowMs: Long): JSONObject {
val reply = JSONObject().put("room", Rooms.name).put("look", look()).put("serverMs", nowMs)
val channel = screen.channels().firstOrNull { it.number == screen.selected() } ?: return reply.put("channel", JSONObject.NULL)
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 3ab113f6..3a473214 100644
--- a/android/app/src/main/java/tv/orbit/classic/PhoneLink.kt
+++ b/android/app/src/main/java/tv/orbit/classic/PhoneLink.kt
@@ -491,7 +491,7 @@ internal object PhoneLink {
fun body() = runCatching { JSONObject(r.body) }.getOrNull() ?: JSONObject()
fun onScreen(block: () -> Unit) = runBlocking { withContext(mainDispatcher) { block() } }
when ("${r.method} ${r.path}") {
- "GET /api/now" -> json(out, 200, OrbitCompanion.now(s, now).put("queue", OrbitCompanion.queueJson()))
+ "GET /api/now" -> json(out, 200, OrbitCompanion.now(s, now).put("queue", OrbitCompanion.queueJson()).put("onTv", OrbitCompanion.onTv))
"GET /api/guide" -> json(out, 200, OrbitCompanion.guide(s, now))
"GET /api/catchup" -> json(out, 200, JSONObject().put("shelves", OrbitCompanion.catchUp(s, now)))
"GET /api/rooms" -> json(out, 200, OrbitCompanion.rooms(appContext))
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 4a5e7007..f0d83a76 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.103")
+ next.setRequestProperty("User-Agent", "OrbitTV/0.108.104")
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/Ticker.kt b/android/app/src/main/java/tv/orbit/classic/Ticker.kt
index e421f058..7aa3fc37 100644
--- a/android/app/src/main/java/tv/orbit/classic/Ticker.kt
+++ b/android/app/src/main/java/tv/orbit/classic/Ticker.kt
@@ -15,7 +15,10 @@ import kotlinx.coroutines.delay
@Composable
internal fun rememberMinuteClock(): State {
val now = remember { mutableLongStateOf(System.currentTimeMillis()) }
- LaunchedEffect(Unit) {
+ // Back from full screen: the time is put right at once, not when the next minute turns (Paul, 8 November 2026).
+ val full = FullScreen.active
+ LaunchedEffect(full) {
+ if (!full) now.longValue = System.currentTimeMillis()
while (true) {
val at = System.currentTimeMillis()
delay(MINUTE_MS - at % MINUTE_MS + 50)
diff --git a/android/app/src/main/res/raw/ident_304.mp4 b/android/app/src/main/res/raw/ident_304.mp4
index 66b0232f..e02f8a4f 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_306.mp4 b/android/app/src/main/res/raw/ident_306.mp4
index 9699e16b..39cc6e01 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/test/java/tv/orbit/classic/ContinueCatchUpOnlyTest.kt b/android/app/src/test/java/tv/orbit/classic/ContinueCatchUpOnlyTest.kt
new file mode 100644
index 00000000..42955cd2
--- /dev/null
+++ b/android/app/src/test/java/tv/orbit/classic/ContinueCatchUpOnlyTest.kt
@@ -0,0 +1,20 @@
+package tv.orbit.classic
+
+import org.junit.Assert.*
+import org.junit.Test
+import java.nio.file.Files
+
+/** 8 November 2026: the lists made while live viewing counted are set aside once, and a new list then stays. */
+class ContinueCatchUpOnlyTest {
+ @Test fun oldListsAreSetAsideOnceOnly() {
+ val dir = Files.createTempDirectory("cw").toFile()
+ val mark = ContinueMark(304, 1000, "abc123", 600_000, 3_600_000, 2000)
+ java.io.File(dir, "continue-grown.json").writeText(org.json.JSONArray(listOf(mark.toJson())).toString())
+ ContinueWatching.load(dir, "grown")
+ assertTrue(ContinueWatching.marks.isEmpty())
+ assertTrue(java.io.File(dir, "continue-grown.json.before-catchup-only").exists())
+ java.io.File(dir, "continue-grown.json").writeText(org.json.JSONArray(listOf(mark.toJson())).toString())
+ ContinueWatching.load(dir, "grown")
+ assertEquals(1, ContinueWatching.marks.size)
+ }
+}