Skip to content

Get rid of org id and download - #1384

Open
hamazaspavetisyan wants to merge 2 commits into
1377-drop-library-xmlfrom
get-rid-of-org-id-and-download-id
Open

hamazaspavetisyan wants to merge 2 commits into
1377-drop-library-xmlfrom
get-rid-of-org-id-and-download-id

Conversation

@hamazaspavetisyan

@hamazaspavetisyan hamazaspavetisyan commented Oct 15, 2026 •

Copy link
Copy Markdown
Collaborator

Follow-up to #1377 (#1383). Based on the 1377-drop-library-xml branch; please review/merge that PR first. Only the last two commits belong to this PR.

With library.xml gone, two Book fields can no longer be stored anywhere: OPDS has no representation for them, and adding one was ruled out in #1377. This PR removes them from the API for libkiwix 15.

Removed public API

Removed Notes
Book::getOrigId(), Book::setOrigId() Only the library.xml reader ever set origId; it was not used by any known client (FeedFormat).
Book::getDownloadId(), Book::setDownloadId() Nothing in libkiwix reads it. It was only saved to and restored from library.xml.

Behavior changes

None.

Library::getBookAttributeCounts() and Library::getBooksLanguagesWithCounts() used to skip books with an origId. Since no book can have one anymore, they now count every book, and their results are unchanged. These functions back getBooksCategories(), getBooksCreators(), getBooksPublishers(), getBooksLanguages() and the /catalog/v2/categories and /catalog/v2/languages feeds.

Impact

Commits

  1. Dropped Book::origId. Removes the getter, setter and field, and the origId checks in src/library.cpp.
  2. Dropped Book::downloadId. Removes the getter, setter and field.

Testing

All 24 test suites pass on macOS. No test change was needed: once #1377 is in, no test uses either field.

@codecov

codecov Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 45.95%. Comparing base (2f2ad9b) to head (8411ec2).

Files with missing lines Patch % Lines
src/library.cpp 0.00% 0 Missing and 3 partials ⚠️
Additional details and impacted files
@@                    Coverage Diff                    @@
##           1377-drop-library-xml    #1384      +/-   ##
=========================================================
+ Coverage                  45.88%   45.95%   +0.06%     
=========================================================
  Files                         58       58              
  Lines                       5067     5055      -12     
  Branches                    2588     2586       -2     
=========================================================
- Hits                        2325     2323       -2     
+ Misses                      1015     1007       -8     
+ Partials                    1727     1725       -2     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@veloman-yunkan

Copy link
Copy Markdown
Collaborator

I think there is some misunderstanding with download id. My impression was that support for it had to be added to OPDS library format, instead of dropping it from kiwix::Book.

@hamazaspavetisyan

Copy link
Copy Markdown
Collaborator Author

I think there is some misunderstanding with download id. My impression was that support for it had to be added to OPDS library format, instead of dropping it from kiwix::Book.

The downloadId was introduced to address specific needs in kiwix-desktop. Adding it to OPDS is not a good idea, as the OPDS library is intended to be generic. Instead, kiwix-desktop can use other methods to identify locally downloaded files. Or you see other uses cases of it ?

@veloman-yunkan

Copy link
Copy Markdown
Collaborator

Instead, kiwix-desktop can use other methods to identify locally downloaded files.

That can be a solution but it has to be implemented first before ditching the previous approach.

@hamazaspavetisyan

hamazaspavetisyan commented Oct 16, 2026 •

Copy link
Copy Markdown
Collaborator Author

Instead, kiwix-desktop can use other methods to identify locally downloaded files.

That can be a solution but it has to be implemented first before ditching the previous approach.

Just did it

kiwix/kiwix-desktop#1543

@hamazaspavetisyan
hamazaspavetisyan force-pushed the get-rid-of-org-id-and-download-id branch from e17e3fd to cad1f01 Compare October 16, 2026 20:41
origId was only ever set by the library.xml reader, which is gone
(#1377), and the OPDS format has no representation for it. Removed
Book::getOrigId() and Book::setOrigId().

Library::getBookAttributeCounts() and getBooksLanguagesWithCounts()
skipped books with an origId. As no book can have one anymore, they now
simply count every book; their results are unchanged.
downloadId was only persisted through library.xml, which is gone
(#1377), and the OPDS format has no representation for it. Nothing in
libkiwix uses it. Removed Book::getDownloadId() and
Book::setDownloadId().

kiwix-desktop uses these methods to link a book to its running download
and needs to keep track of that itself.
@hamazaspavetisyan
hamazaspavetisyan force-pushed the get-rid-of-org-id-and-download-id branch from cad1f01 to 8411ec2 Compare October 19, 2026 09:11
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.

2 participants