Skip to content

feat: download offline archives as files#748

Merged
everpcpc merged 1 commit intomainfrom
codex/offline-archive-downloads
Apr 29, 2026
Merged

feat: download offline archives as files#748
everpcpc merged 1 commit intomainfrom
codex/offline-archive-downloads

Conversation

@everpcpc
Copy link
Copy Markdown
Owner

Problem

Offline downloads for CBZ, CBR, and DIVINA-compatible EPUB books were still using page-by-page stream downloads. That made downloads slow and also diverged from Komga's server-side reading order, especially for DIVINA EPUB files whose manifest reading order may point at XHTML resources rather than image files.

Approach

Download supported archive-like formats through the book file endpoint and extract local reader images from the downloaded file. CBZ, CBR, and DIVINA EPUB extraction now use the server /pages metadata as the source of truth for image order and archive entry names. Background finalization writes sidecar metadata so a resumed app can finish extraction without relying only on in-memory state.

Scope

  • Add Unrar.swift for CBR extraction.
  • Route CBZ and CBR offline downloads through single-file archive extraction.
  • Route DIVINA-compatible EPUB downloads through EPUB file extraction while keeping only image pages.
  • Persist .archive-pages.json and .webpub-manifest.json sidecars for background download recovery.
  • Mark WebPub, DIVINA, and generic JSON DTOs as nonisolated value models for Swift 6 Codable use.

Validation

  • make format
  • make build-macos
  • make build-ios
  • make build-tvos
  • git diff --check

Download CBZ, CBR, and DIVINA-compatible EPUB content through the book file endpoint and extract local page images using server page metadata as the ordering source. Persist page metadata and WebPub manifests as sidecars for background finalization recovery, and add Unrar support for CBR extraction.
@everpcpc everpcpc merged commit 0717265 into main Apr 29, 2026
3 checks passed
@everpcpc everpcpc deleted the codex/offline-archive-downloads branch April 29, 2026 05:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant