Memby v0.1.53: Android TV client plus gateway

Android TV client for Emby (Kotlin, Compose for TV) and the Memby gateway
(Go, Postgres, Redis) that fronts it.

Client:
- Setup, profiles, home rows, Media3 playback, system screensaver (Dream)
- Backend chosen at build time: gateway when memby.gatewayUrl is set,
  otherwise direct to Emby. Both paths stay working.
- Server-composed home rows, rendered verbatim so new row types ship
  without an app release
- Full-screen animated maintenance state, row engagement telemetry

Gateway:
- One request per TV screen; auth, caching, search and row shaping
- Library import from Emby into Postgres (manual, then hourly incremental)
- Recommendations from viewing history (recency-weighted genre affinity)
- Admin page for imports, an offline switch, and per-row analytics
- Video always direct-plays from Emby; only metadata passes through

Identity is com.ponzischeme89.memby throughout, replacing
com.mattcohen.embyclientsname. A changed applicationId installs as a new
app: TVs need a fresh sign-in and the old package uninstalled.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
ponzischeme89
2026-07-27 08:16:20 +12:00
co-authored by Claude Opus 5
commit 2ce405c540
99 changed files with 14433 additions and 0 deletions
+44
View File
@@ -0,0 +1,44 @@
plugins {
id("com.android.test")
id("org.jetbrains.kotlin.android")
}
android {
namespace = "com.ponzischeme89.memby.benchmark"
compileSdk = 35
defaultConfig {
minSdk = 23
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
testInstrumentationRunnerArguments["androidx.benchmark.enabledRules"] = "Macrobenchmark"
// The target is the current debug build for Phase 1 only. Results are labelled
// debug-influenced; a release benchmark variant will be added before Phase 2.
testInstrumentationRunnerArguments["androidx.benchmark.suppressErrors"] = "DEBUGGABLE"
}
targetProjectPath = ":app"
experimentalProperties["android.experimental.self-instrumenting"] = true
compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
buildTypes {
create("release") {
initWith(getByName("debug"))
isDebuggable = false
}
}
}
kotlin {
compilerOptions {
jvmTarget.set(org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_17)
}
}
dependencies {
implementation("androidx.benchmark:benchmark-macro-junit4:1.2.4")
implementation("androidx.test.ext:junit:1.2.1")
implementation("androidx.test:runner:1.6.2")
}
+4
View File
@@ -0,0 +1,4 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<application android:requestLegacyExternalStorage="true" />
</manifest>
@@ -0,0 +1,47 @@
package com.ponzischeme89.memby.benchmark
import androidx.benchmark.macro.CompilationMode
import androidx.benchmark.macro.FrameTimingMetric
import androidx.benchmark.macro.MacrobenchmarkScope
import androidx.benchmark.macro.StartupMode
import androidx.benchmark.macro.StartupTimingMetric
import androidx.benchmark.macro.junit4.MacrobenchmarkRule
import androidx.test.ext.junit.runners.AndroidJUnit4
import org.junit.Rule
import org.junit.Test
import org.junit.runner.RunWith
@RunWith(AndroidJUnit4::class)
class HomeBenchmark {
@get:Rule val benchmarkRule = MacrobenchmarkRule()
@Test
fun coldStartToHome() = benchmarkRule.measureRepeated(
packageName = "com.ponzischeme89.memby",
metrics = listOf(StartupTimingMetric()),
compilationMode = CompilationMode.None(),
startupMode = StartupMode.COLD,
iterations = 3,
setupBlock = { pressHome() },
measureBlock = { startActivityAndWait() },
)
@Test
fun homeDpadAndRows() = benchmarkRule.measureRepeated(
packageName = "com.ponzischeme89.memby",
metrics = listOf(FrameTimingMetric()),
compilationMode = CompilationMode.None(),
startupMode = StartupMode.WARM,
iterations = 3,
setupBlock = { startActivityAndWait() },
measureBlock = { exerciseHome() },
)
private fun MacrobenchmarkScope.exerciseHome() {
device.pressKeyCode(android.view.KeyEvent.KEYCODE_DPAD_RIGHT)
device.pressKeyCode(android.view.KeyEvent.KEYCODE_DPAD_RIGHT)
device.pressKeyCode(android.view.KeyEvent.KEYCODE_DPAD_DOWN)
device.pressKeyCode(android.view.KeyEvent.KEYCODE_DPAD_RIGHT)
device.waitForIdle()
}
}