Repository navigation
ADFA-4893 — Books: homologate to the ZIM download contract - #474
Merged
Merged
Conversation
…mpotent resume Books now follows the ZIM/rootfs reconnect contract: the books runner reports its retry state via ctx.reportRetry (onRetry + cleared per item), so the poll carries retryAttempt/retryTotal and the app can show "Reconnecting… n of 5". And the runner is idempotent on resume — presentTitles() skips books already in the Calibre-Web library (by title) instead of re-downloading + re-uploading, which duplicated entries and reset the percent; this also makes a resume after process death safe. Bump 1.2.7-dev.1.
…ADFA-4893-books-homologate
…ntrols Generalize RestContentClient to type-parametric (start(body)) and interpret the poll by percent + retry state, not the phase name, so kiwix (downloading/indexing) and books (processing) share one client. Re-point BooksDownloadService onto it: pause/resume, onPaused/onReconnecting, poll percent, server cancel — dropping its inline POST/poll and the app-side retry loop (the server owns reconnection now). BooksDownloadsFragment gets the morphing Pause⇄Resume⇄Retry + Cancel row and the "Reconnecting… n of N" / paused labels (per-item pill removed); Finish/Run-in- background stay for the standalone Books flow. Books index row gets the item-count bar. ZIM unchanged (no-arg client ctor).
…ks next drain) ACTION_CANCEL stopped the download but left the item non-terminal (ACTIVE), so the session couldn't be dismissed and PendingContent.anyUnfinished stayed true, blocking the next drain — a canceled book/zim got stuck and re-selecting never downloaded. Cancel now calls finishSession() (clears the list; hasSession→false) + publish, so the screen clears and the next drain runs. client.cancel() already cancels the server job.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Brings Books up to the treatment ZIM got: visible auto-reconnect, one morphing control
(Pause⇄Resume⇄Retry) + always-Cancel, and an idempotent resume — so both content types
behave identically. One PR under the download-contract story; no new tickets.
dash-node (server)
ctx.reportRetry), soGET /books/jobs/:idcarriesretryAttempt/retryTotal→ the app shows "Reconnecting…n of 5" (books' 6-try per-item budget = n of 5, same label as ZIM).
presentTitles()skips books already in the Calibre-Web library(by title) instead of re-downloading + re-uploading them — which duplicated entries and
reset the percent to 0. Also makes a resume after process death safe (ADFA-4897).
app (convergence)
server cancel (today local-only).
background to SetupProgressActivity (as ZIM); index-row determinate bar.
Not in this PR
Verification
On dash-node ≥ 1.2.7: start a Books download, drop Wi-Fi mid-download → "Reconnecting…
n of 5"; Pause/Resume/Cancel/Retry behave like ZIM; a resume does not duplicate books.