diff --git a/android/app/build.gradle.kts b/android/app/build.gradle.kts index 535105e0..fb6cae2d 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 = 70 +val ORBIT_BUILD = 71 android { namespace = "tv.orbit.classic" compileSdk = 36 diff --git a/android/app/src/household/java/tv/orbit/classic/InstallSnapshot.kt b/android/app/src/household/java/tv/orbit/classic/InstallSnapshot.kt index bc690a78..264a5a7d 100644 --- a/android/app/src/household/java/tv/orbit/classic/InstallSnapshot.kt +++ b/android/app/src/household/java/tv/orbit/classic/InstallSnapshot.kt @@ -20,7 +20,10 @@ import java.security.MessageDigest * only while Orbit's screen isn't open, only files a snapshot takes, each checked against its checksum first, and the * current data is kept aside before anything is replaced. * - * Apart from `restore`, it only ever copies; it never changes the schedules, the library or the sign-in. + * - `approve-add` (23 November 2026): titles you approved outside the app, from install-restore/approve.json, added to their + * channels' lists with `confirm ADD` while Orbit's screen isn't open. See [ApprovedTitles]: it only adds. + * + * Apart from `restore` and `approve-add`, it only ever copies; it never changes the schedules, the library or the sign-in. */ class InstallSnapshotReceiver : BroadcastReceiver() { override fun onReceive(context: Context, intent: Intent) { @@ -42,6 +45,21 @@ class InstallSnapshotReceiver : BroadcastReceiver() { tv.orbit.classic.arcade.hive.HiveLegacy.adoptCopy(File(context.filesDir, "arcade"), incoming, intent.getStringExtra("sha256"), intent.getStringExtra("confirm"), intent.getStringExtra("from"), System.currentTimeMillis()) } finally { incoming.delete() } + } else if (intent.getStringExtra("do") == "approve-add") { + // Titles you approved outside the app ([ApprovedTitles]): adb pushes install-restore/approve.json; it's read once and removed. + val incoming = File(context.getExternalFilesDir(null), "install-restore/approve.json") + try { + val target = Workspaces.current(context) + resultData = when { + intent.getStringExtra("confirm") != "ADD" -> "refused: needs confirm ADD" + OrbitScreen.open -> "refused: Orbit is open; force-stop it first" + !incoming.exists() -> "refused: no approve.json" + else -> ServerMove.userOf(target.scheduleDir)?.let { user -> + ApprovedTitles.add(target.scheduleDir, user, org.json.JSONArray(incoming.readText()), System.currentTimeMillis()) } ?: "refused: no saved schedules" + } + } catch (e: Exception) { resultData = "failed: ${e.javaClass.simpleName}" } finally { incoming.delete() } + android.util.Log.i("OrbitInstall", "approve-add: $resultData") + return } else if (intent.getStringExtra("do").orEmpty().startsWith("move-")) { // Reading two catalogues takes a few seconds: off the main thread, answered when done. val pending = goAsync() diff --git a/android/app/src/main/java/tv/orbit/classic/ApprovedTitles.kt b/android/app/src/main/java/tv/orbit/classic/ApprovedTitles.kt new file mode 100644 index 00000000..9e46ddf7 --- /dev/null +++ b/android/app/src/main/java/tv/orbit/classic/ApprovedTitles.kt @@ -0,0 +1,55 @@ +package tv.orbit.classic + +import org.json.JSONArray +import org.json.JSONObject +import java.io.File + +/** + * Titles you approved outside the app (Stage 3 replacements, 23 November 2026), added to channels' lists exactly as the + * Director's Chair places a title: each joins its channel's list at the next top-up, and nothing already booked moves. + * + * - it only adds: nothing on a list is removed or changed, and a title you approve comes off that channel's "rejected" list + * (your approval is the newer decision), as it does in the Chair; + * - a title already on the channel, as the same item or another copy of the same work (name and year), isn't added twice, + * so running it again changes nothing; + * - every channel file it touches is kept as it was in approved-