Repository navigation
ADFA-5094: generate the offline topic-tree bundle and publish it to R2 - #425
Merged
Merged
Conversation
Extend the catalog generator (run by publish-catalogs.yml and the refreshKolibriCatalog
gradle task) to also walk Studio's contentnode_tree and emit the topic tree, so the app can
browse channels offline. --measure walks the trees once and prints raw+gzip sizes for both
variants with a walked-vs-catalog resource cross-check; --tree {topics,full} writes the
chosen asset. topics keeps folders + a per-folder aggregate of direct loose resources
(dcount/dbytes), an order of magnitude smaller than full; the live source fills leaf titles
online. Tooling only: nothing in the APK changes yet.
…tree API
The API crawl 400s on ~half the channels and returns only shallow data (measured: 561 of
352,591 resources walked). Switch to downloading each channel's published content DB (the
.sqlite3 that remoteimport uses) and reading content_contentnode + content_file directly:
complete and reliable, one download per channel. topics now also carries per-folder subtree
bytes for the folder aggregate. Same flags (--measure / --tree {topics,full}); tooling only.
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.
Adds the offline topic-tree bundle to the catalog pipeline — the data half of browsing
Kolibri topics offline (the app that reads it is a separate PR).
build_kolibri_catalog.py gains a tree mode: --tree {topics,full} emits kolibri_tree.jsonl,
one folder per line with the aggregates measured over each channel's published content DB
(subtree resource count + bytes, plus each folder's direct loose-resource count/bytes). It
reads the channels' SQLite DBs directly instead of crawling the public contentnode_tree API,
which 400s on many channels and returns shallow data; a --measure flag cross-checks node
counts against the catalog. Default catalog mode is unchanged.
The catalog workflow now also runs the tree generator and uploads kolibri_tree.jsonl to
Cloudflare R2 under "kolibri-tree", the same publish() path the catalog and kiwix use. The
app pulls it on Wi-Fi; there is no APK-committed floor, so until the first pull the tree
source is empty and the picker falls back to box/Studio.
Verified: the generator run over the published DBs matches the catalog's resource total
(~352,593 vs 352,591); topics variant ~78k folders, ~3.3 MB gzip. Default catalog output
unchanged (--from-file). Workflow YAML lints; no conflict with main on either file.