-
-
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
Support for multiple illustrations in a Book #630
Conversation
Codecov Report
@@ Coverage Diff @@
## master #630 +/- ##
==========================================
+ Coverage 66.14% 66.62% +0.48%
==========================================
Files 53 53
Lines 3819 3823 +4
Branches 1914 1931 +17
==========================================
+ Hits 2526 2547 +21
+ Misses 1291 1274 -17
Partials 2 2
Continue to review full report at Codecov.
|
95fe5f6
to
11ee716
Compare
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.
This goes in the right direction but it is not enough :
- "Default" book should have no illustration.
- A book/zim may have no default illustration or even no illustration at all. The spec says we must create a zim file with a illustration but nothing really prevent someone to create a zim not following the spec (And it is what we done in old zim files)
I would move to :
- Use
Illustrations
vector all the time. (const Illustration). - Create illustration only when we are sure we have one.
- I'm not sure we need a
getDefaultIllustration
at all.
And we must make evolved the library xml format to support multiple illustrations (which is not a easy part as we also need to keep (forward at least) compatibility)
@mgautierfr This contradicts |
Yes, the However, in the same time, we should keep the android API (at least until we have moved the wrapper in https://github.com/kiwix/java-libkiwix and have a proper wrapper there). On my side it is ok to drop the |
f14aed3
to
3a9b8df
Compare
Done. |
The only remaining arguable point seems to be whether |
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've got one last issue. I think it would be better to handle it now but I'm ok if you think we should not.
Else we are good.
I've got a segmentation fault when I run kiwix-desktop compiled with this PR. |
@mgautierfr No segfault with my |
Some time (I'm not sure now). |
@mgautierfr My build doesn't crash |
I've rebuild all the projects and it doesn't crash now. Probably some kind of ABI change conflict with a |
Book.updateTest is going to be modified so that it relies on functionality tested by Book.updateFromXMLTest. Hence the order of the tests better reflect that dependency.
... thus eliminating the need for the Book::setFavicon*() methods.
`Book::m_favicon` and its 2 friends are replaced with a single `Book::m_illustration` data member.
Now a Book is created without a default illustration.
bb5ca83
to
eb6a0d6
Compare
The PR is now cleaned-up and rebased. |
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.
There is still few things I've found.
The m_illustrations.clear()
is pretty easy to add so it would be nice to have it right now.
The race condition may be addressed now or with the other potential race condition in Book::getDefaultIllustration
66ac0bb
to
4a01081
Compare
Fixes #625.
Note that this fix only adds support for multiple illustrations inside the
kiwix::Book
class, without enhancing the library format. As a result, ZIM files with multiple illustrations will not appear as such in the OPDS output if the kiwix server is started with a trusted library.