1.0 RC3: household budgets, a plain message when the server isn't answering, This is my server

- Background budget shared by the household's TVs on a server (this TV plus the
  rooms it's linked to or set up); each TV's ceiling comes down too, never below 250.
- Tuning says "Waiting for your server to answer…" after 8 s; a timeout or no
  connection (ServerNotAnswering) shows a plain message and retries every 30 s
  instead of giving the programme up (13 Nov: Emby froze for six minutes).
- Help and account: This is my server (the own-server flag, off unless switched on).
- Version 1.0.0-rc3, build 45.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-13 17:29:34 +00:00
co-authored by Claude Opus 5.5
parent c5e6d0cb35
commit 8be7790ad4
8 changed files with 66 additions and 11 deletions
@@ -0,0 +1,22 @@
package tv.orbit.classic
import org.junit.Assert.*
import org.junit.Test
/** 1.0 RC3 (Paul): limits sized for the whole house, so a second TV doesn't double what the server gets. */
class HouseholdBudgetTest {
@org.junit.After fun reset() = BackgroundPacing.resetForTest()
@Test fun twoTvsShareTheBackgroundBudgetAndTheCeilingComesDown() {
BackgroundPacing.tvs = 1
assertEquals(200, BackgroundPacing.share(BackgroundPacing.HOURLY_BUDGET))
assertEquals(400, BackgroundPacing.ceiling)
BackgroundPacing.tvs = 2
assertEquals(100, BackgroundPacing.share(BackgroundPacing.HOURLY_BUDGET))
assertEquals(50, BackgroundPacing.share(QUIET_START_BUDGET))
// Never so low that watching plus a little background can't fit.
assertEquals(BackgroundPacing.MIN_CEILING, BackgroundPacing.ceiling)
BackgroundPacing.tvs = 10
assertEquals(25, BackgroundPacing.share(BackgroundPacing.HOURLY_BUDGET))
assertEquals(BackgroundPacing.MIN_CEILING, BackgroundPacing.ceiling)
}
}