libkiwix icon indicating copy to clipboard operation
libkiwix copied to clipboard

Filter ZIMs by humanid & aliases

Open juuz0 opened this issue 3 years ago • 10 comments

Fixes #807

juuz0 avatar Aug 15 '22 16:08 juuz0

Example test link: http://192.168.18.8:8080/?book=termux_en_all_maxi_2022-05&book=installgentoo_en_all_nopic_2019-09 image

juuz0 avatar Aug 15 '22 16:08 juuz0

Pretty sure that installgentoo_en_all_nopic_2019-09 is not the zim name metadata. It's the human friendly name.

kelson42 avatar Aug 15 '22 17:08 kelson42

It's the filename (whatever it is on system, you can try changing a file name and see). ZIM's name field is not unique as per my observation (for example archwiki_en_all__nopic and archwiki_en_all__maxi have the same name: archwiki_en_all)

juuz0 avatar Aug 15 '22 17:08 juuz0

@kelson42 Updated to use alias name. image

juuz0 avatar Aug 15 '22 19:08 juuz0

Codecov Report

Base: 70.51% // Head: 71.13% // Increases project coverage by +0.62% :tada:

Coverage data is based on head (151106d) compared to base (86eacea). Patch coverage: 100.00% of modified lines in pull request are covered.

:exclamation: Current head 151106d differs from pull request most recent head 2cd0579. Consider uploading reports for the commit 2cd0579 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #808      +/-   ##
==========================================
+ Coverage   70.51%   71.13%   +0.62%     
==========================================
  Files          53       53              
  Lines        3653     3756     +103     
  Branches     2029     2089      +60     
==========================================
+ Hits         2576     2672      +96     
- Misses       1075     1082       +7     
  Partials        2        2              
Impacted Files Coverage Δ
include/name_mapper.h 71.42% <ø> (ø)
include/library.h 100.00% <100.00%> (ø)
src/library.cpp 83.97% <100.00%> (+0.56%) :arrow_up:
src/name_mapper.cpp 100.00% <100.00%> (ø)
src/server/internalServer.cpp 88.09% <100.00%> (+0.14%) :arrow_up:
src/server/response.cpp 92.06% <0.00%> (-1.60%) :arrow_down:
src/server/internalServer_catalog_v2.cpp 92.85% <0.00%> (-0.17%) :arrow_down:
include/server.h 100.00% <0.00%> (ø)
src/server/i18n.h 100.00% <0.00%> (ø)
src/server/response.h 100.00% <0.00%> (ø)
... and 2 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

codecov[bot] avatar Aug 15 '22 19:08 codecov[bot]

@juuz0 Thx, it's great if can now work with both filename and aliases. I will test it. Reading the source code, I have too remarks:

  • supporting of aliases shoud probably works only if --nodatealiases is used (just to be coherent)
  • I would reuse the same primitive like there to compute the alias name

kelson42 avatar Aug 16 '22 03:08 kelson42

@juuz0 Any feedback?

kelson42 avatar Aug 24 '22 14:08 kelson42

I want to mention this new issue #828 Please remember the server can be run with a namemapper using the book uuid as a name (https://github.com/kiwix/libkiwix/blob/master/include/name_mapper.h#L41-L45) and it is the default name mapper for kiwix::Server.

Be sure that you are not assuming too much that we will use a HumanReadableNameMapper

mgautierfr avatar Oct 04 '22 14:10 mgautierfr

This pull request has been automatically marked as stale because it has not had recent activity. It will be now be reviewed manually. Thank you for your contributions.

stale[bot] avatar Nov 02 '22 04:11 stale[bot]

@juuz0 Any feedback?

kelson42 avatar Nov 08 '22 04:11 kelson42