feat(system): multipart backup import via SAF picker — replace path-based import (issue #786) (#839)

* feat(system): multipart backup import via SAF picker — replace path-based import (issue #786)

* fix(system): backup trigger sends required JSON body — 422 fix (BackupRequest contract)

* fix(system): backup download waits for async archive + saves to Downloads

* fix(system): curator min_idle_hours Double parse + single-flight backup download

* fix(system): stream backup download to Downloads — @Streaming + chunked MediaStore write (OOM fix)

---------

Co-authored-by: M57 <hy4ri@users.noreply.github.com>
This commit is contained in:
M57andM57 authored and GitHub committed 2026-08-07 16:44:41 +03:00
1 parent 9d0baa78fd
commit 7998248507
8 files changed
+358 -43

No files matched your search

@@ -12,3 +12,13 @@ data class ActionResponse(
val uploaded_bytes: Long? = null,
val update_command: String? = null,
)
/**
* Body for POST /api/ops/backup — the backend requires a JSON body
* (BackupRequest; `output` optional). Sending no body at all gets a 422.
* Empty object (default) matches the desktop's `{"output": ...}` contract.
*/
@Serializable
data class BackupTriggerRequest(
val output: String? = null,
)
@@ -7,7 +7,9 @@ data class CuratorResponse(
val paused: Boolean? = null,
val interval_hours: Int? = null,
val last_run_at: String? = null,
val min_idle_hours: Int? = null,
// Backend sends a float (e.g. 2.0) — Int here broke JSON parsing (logcat
// "Unexpected symbol '.' in numeric literal at path: $.min_idle_hours").
val min_idle_hours: Double? = null,
val stale_after_days: Int? = null,
val archive_after_days: Int? = null,
)