From ba282854fc6760e82fa75c6dd9f70525bdc9b71f Mon Sep 17 00:00:00 2001 From: Pauljd Date: Tue, 1 Dec 2026 12:02:45 +0000 Subject: [PATCH] Every new channel finished in the same round (build 88) Paul, 1 December 2026: build 87 finished one new channel's list per round, about an hour apart (Wonder TV 08:24, Heroes Live 09:35, Horror TV 10:37 downstairs). Every channel still on its first read is now finished in the same round, one after another, at setup's pace and within setup's hourly cap, then rebooked. Co-Authored-By: Claude Opus 5.5 --- android/app/build.gradle.kts | 2 +- .../main/java/tv/orbit/classic/ChannelScheduler.kt | 12 ++++-------- docs/CHANGELOG-build88.md | 10 ++++++++++ 3 files changed, 15 insertions(+), 9 deletions(-) create mode 100644 docs/CHANGELOG-build88.md diff --git a/android/app/build.gradle.kts b/android/app/build.gradle.kts index c0adeccf..2e5bc858 100644 --- a/android/app/build.gradle.kts +++ b/android/app/build.gradle.kts @@ -3,7 +3,7 @@ plugins { id("org.jetbrains.kotlin.plugin.compose") } /** The release's build number: versionCode is this x 10 plus the edition's channel. */ -val ORBIT_BUILD = 87 +val ORBIT_BUILD = 88 android { namespace = "tv.orbit.classic" compileSdk = 36 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 8cd9aee1..a6ee80f0 100644 --- a/android/app/src/main/java/tv/orbit/classic/ChannelScheduler.kt +++ b/android/app/src/main/java/tv/orbit/classic/ChannelScheduler.kt @@ -13,8 +13,6 @@ internal const val POOL_REFRESH_MS = 7 * 24 * 60 * 60_000L */ internal const val POOL_JITTER_MS = 48 * 60 * 60_000L internal const val POOL_ROUTINE_GAP_MS = 30 * 60_000L -/** A new channel's first read is finished in one go at most this often, so two never run at once ([ChannelScheduler.refreshStepwise]). */ -internal const val FIRST_READ_FINISH_GAP_MS = 10 * 60_000L internal fun poolJitterMs(number: Int): Long = (number.toLong() * 7_919L % 48L) * 60 * 60_000L /** Whether a cached list is old enough for its routine refresh. */ internal fun poolRefreshDue(fetchedAtMs: Long, number: Int, nowMs: Long) = nowMs - fetchedAtMs >= POOL_REFRESH_MS + poolJitterMs(number) @@ -84,8 +82,6 @@ internal class ChannelScheduler(private val store: ScheduleStore, } /** When this TV last made a routine (weekly) list refresh; at most one per [POOL_ROUTINE_GAP_MS]. */ @Volatile internal var lastRoutineRefreshMs = 0L - /** When a first read was last finished in one go ([refreshStepwise]): one channel at a time. */ - @Volatile private var lastFirstReadFinishMs = 0L /** The order routine refreshes go in: see [RoutineQueue]. */ internal val routineQueue = RoutineQueue() /** Disk only and quick, so the guide and player agree from the first frame after a restart. */ @@ -436,10 +432,10 @@ internal class ChannelScheduler(private val store: ScheduleStore, val refresh = PoolRefresh(programming, choices, cached.series, earlierFilms(loop)) val waiting = synchronized(refreshWaiting) { refreshWaiting.size + if (number in refreshWaiting) 0 else 1 } // A new channel's first read (its pool has no signature yet) is finished in one go, at setup's pace and within setup's - // hourly cap, one channel at a time (Paul, 1 December 2026), so its week is booked from all its shows within minutes, - // not a fair share a round over days. Later refreshes go a fair share at a time as before. - val firstRead = cached.signature.isEmpty() && now - lastFirstReadFinishMs >= FIRST_READ_FINISH_GAP_MS - if (firstRead) lastFirstReadFinishMs = now + // hourly cap (Paul, 1 December 2026), so its week is booked from all its shows within minutes, not a fair share a round + // over days. Every new channel waiting is finished in the same round, one after another: setup's pacing keeps their + // requests a second apart however many there are. Later refreshes go a fair share at a time as before. + val firstRead = cached.signature.isEmpty() val share = if (firstRead) Int.MAX_VALUE else refreshShare(BackgroundPacing.budget, BackgroundPacing.usedThisHour(), waiting) val step = try { if (firstRead) BackgroundPacing.asSetup { diff --git a/docs/CHANGELOG-build88.md b/docs/CHANGELOG-build88.md new file mode 100644 index 00000000..f9ae6713 --- /dev/null +++ b/docs/CHANGELOG-build88.md @@ -0,0 +1,10 @@ +# Build 88 (version code 880): change log + +Build 87 plus the change below, on `horror-tv`. + +## Every new channel finished in the same round (Paul, 1 December 2026) + +- Build 87 finished one new channel's list per round, and rounds come about once an hour, so three new channels took three + hours downstairs (Wonder TV 08:24, Heroes Live 09:35, Horror TV 10:37). Now every channel still on its first read is + finished in the same round, one after another, at setup's pace (a request a second) and within setup's hourly cap, and + each is booked again with its whole list as soon as it's done.