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 9b5cc400..e9d64202 100644 --- a/android/app/src/household/java/tv/orbit/classic/InstallSnapshot.kt +++ b/android/app/src/household/java/tv/orbit/classic/InstallSnapshot.kt @@ -26,9 +26,11 @@ import java.security.MessageDigest * - `fix-booking` (23 November 2026): one booking replaced by hand, from install-restore/fix.json, with `confirm FIX` while * Orbit's screen isn't open. See [BookingFix]: nothing else in the plan moves. * + * - `approve-withdraw` (23 November 2026): approvals withdrawn, from install-restore/withdraw.json, with `confirm WITHDRAW` while + * Orbit's screen isn't open. See [ApprovedTitles.withdraw]: only the accepted list changes, kept aside first. * - `release-runtime` (23 November 2026): a film held for an odd running time, let through (`--es id`, `confirm RELEASE`). * - * Apart from `restore`, `approve-add`, `fix-booking` and `release-runtime`, it only ever copies; it never changes the schedules, the library or the sign-in. + * Apart from `restore`, `approve-add`, `approve-withdraw`, `fix-booking` and `release-runtime`, 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) { @@ -72,6 +74,21 @@ class InstallSnapshotReceiver : BroadcastReceiver() { else ScheduleStore(target.scheduleDir).runtimeReleases().add(intent.getStringExtra("id").orEmpty()) android.util.Log.i("OrbitInstall", "release-runtime: $resultData") return + } else if (intent.getStringExtra("do") == "approve-withdraw") { + // Approvals you've withdrawn ([ApprovedTitles.withdraw]): adb pushes install-restore/withdraw.json; it's read once and removed. + val incoming = File(context.getExternalFilesDir(null), "install-restore/withdraw.json") + try { + val target = Workspaces.current(context) + resultData = when { + intent.getStringExtra("confirm") != "WITHDRAW" -> "refused: needs confirm WITHDRAW" + OrbitScreen.open -> "refused: Orbit is open; force-stop it first" + !incoming.exists() -> "refused: no withdraw.json" + else -> ServerMove.userOf(target.scheduleDir)?.let { user -> + ApprovedTitles.withdraw(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-withdraw: $resultData") + return } else if (intent.getStringExtra("do") == "fix-booking") { // One booking replaced by hand ([BookingFix]): adb pushes install-restore/fix.json; it's read once and removed. val incoming = File(context.getExternalFilesDir(null), "install-restore/fix.json") diff --git a/android/app/src/main/java/tv/orbit/classic/ApprovedTitles.kt b/android/app/src/main/java/tv/orbit/classic/ApprovedTitles.kt index 9e46ddf7..d588b256 100644 --- a/android/app/src/main/java/tv/orbit/classic/ApprovedTitles.kt +++ b/android/app/src/main/java/tv/orbit/classic/ApprovedTitles.kt @@ -49,6 +49,40 @@ internal object ApprovedTitles { return "added $added:$report" + if (keep.exists()) " (kept ${keep.name})" else "" } + /** + * Approvals you've withdrawn (Paul, 23 November 2026: the mainstream horror carried across to After Dark is Horror's). Each + * entry names a channel and an item id, or a title and year for every copy of that work. Only the accepted list changes: + * nothing is rejected, so the Chair may still suggest a title again, and nothing already booked moves. The channel's file + * is kept as it was in withdrawn-