-
-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Functions to read OPDS streams - languages and categories #967
Conversation
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #967 +/- ##
==========================================
+ Coverage 38.87% 38.89% +0.01%
==========================================
Files 56 58 +2
Lines 3974 4006 +32
Branches 2187 2204 +17
==========================================
+ Hits 1545 1558 +13
- Misses 1097 1099 +2
- Partials 1332 1349 +17
☔ View full report in Codecov by Sentry. |
@juuz0 Ready to review? Code coverage does not pass, new functions should be tested. |
@kelson42 added tests, CI/macOS seems to be a CI issue - failing for other PRs too Yes, ready for review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure those functions are put at the right place.
The Manager
has been created to manage a library. The Library
being a "simple" container of Book
s.
But here, parseLanguages
and parseCategories
do not manage everything. They are "just" parsing a feed.
This could be simple free function instead of method of Manager. And if we want them to be part of Manager
(to make it something that "parse content"), it should be static method to allow the user to call them without creating a Manager
instance first.
If fact, they are the equivalent of Library::getBooksLanguages
or Library::getBooksCategories
, but for a abstract "remote Library". Maybe there is a new class (potentially sharing the same common interface than Library
) to create to correctly handle remote library.
@juuz0 Can you please create the corresponding issue to explain what is the problem you face with libkiwix? |
Having a remote library class felt like it should handle the download requests to I put these functions in |
c4b2a6d
to
09739c8
Compare
Rebased |
@juuz0 @mgautierfr Please talk together, it's not good to see this PR somehow stuck since a week. |
@mgautierfr Review needed! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Few small fixes.
And tests are failing.
bd1348f
to
287f876
Compare
Fixed. On my PC, the value was |
Rebased after the recent merge |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed. On my PC, the value was "und" for getLanguageSelfName(""). On the CI, it was ""
I made it compulsory to return "und" for empty string.
I'm a bit disturbed by this.
Why getLanguageSelfName
return to different things. This means that ICU return different things for icu::Local::getISOLanguages
. We must understand why.
From where is "und" coming on your PC ?
@mgautierfr After some investigation, I found that this happens when a
I suspect the ubuntu-focal behaviour was unwanted (see ticket) and fixed in a later ICU version (ICU 69.1. ubuntu jammy uses 70.1) I think we should keep the mapping so it stays consistent across all 3 ubuntu builds |
ok. I agree. And "Undetermined" is indeed better. |
These files were overlooked during a merge of another PR
Added a new function to read languages stored in an OPDS feed
Added a function to load categories stored in an OPDS stream
Added tests on a sample OPDS language and categories stream
This is a general utility which other ports can get use of. Added tests
Fixes #968
Requirement for: kiwix/kiwix-desktop#960