Skip to content
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

getMediaCount does not fail if M/Counter is missing. #827

Merged
merged 1 commit into from
Oct 17, 2023

Conversation

mgautierfr
Copy link
Collaborator

  • M/Counter is not mandatory.
  • zimcheck doesn't check for it.
  • we already accept a missing M/Counter in getArticleCount.

No reason to fail in getMediaCount if M/Counter is missing.

We test it by reading an empty zim file.
This reveal a bug in getNamespaceBeginOffset when there is no dirent in the direntAccessor.

Fix kiwix/kiwix-tools#640

- `M/Counter` is not mandatory.
- zimcheck doesn't check for it.
- we already accept a missing `M/Counter` in `getArticleCount`.

No reason to fail in `getMediaCount` if `M/Counter` is missing.

We test it by reading an empty zim file.
This reveal a bug in `getNamespaceBeginOffset` when there is no dirent
in the direntAccessor.
@codecov
Copy link

codecov bot commented Oct 10, 2023

Codecov Report

Attention: 8 lines in your changes are missing coverage. Please review.

Comparison is base (bd8f79c) 57.53% compared to head (167be70) 57.57%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #827      +/-   ##
==========================================
+ Coverage   57.53%   57.57%   +0.04%     
==========================================
  Files          98       98              
  Lines        4540     4545       +5     
  Branches     1907     1911       +4     
==========================================
+ Hits         2612     2617       +5     
+ Misses        674      668       -6     
- Partials     1254     1260       +6     
Files Coverage Δ
src/dirent_lookup.h 58.75% <0.00%> (+1.05%) ⬆️
src/archive.cpp 48.76% <40.00%> (+0.22%) ⬆️

... and 1 file with indirect coverage changes

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

@kelson42 kelson42 added this to the 9.0.0 milestone Oct 10, 2023
@mgautierfr mgautierfr merged commit 6460196 into main Oct 17, 2023
30 of 31 checks passed
@mgautierfr mgautierfr deleted the fallback_no_counter branch October 17, 2023 08:53
@kelson42 kelson42 changed the title getMediaCount do not fail if M/Counter is missing. getMediaCount does not fail if M/Counter is missing. Nov 1, 2023
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.

kiwix-serve is unable to add ZIM to internal library despite zimcheck passing
3 participants