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

Make OPDSDumper respect the NameMapper of the server. #837

Merged
merged 2 commits into from
Oct 31, 2022

Conversation

mgautierfr
Copy link
Member

@mgautierfr mgautierfr commented Oct 19, 2022

It is an extract of #830 which become a bit too big because of associated refactoring.
This PR concentrate on fixing #828

Fixes #828

@codecov
Copy link

codecov bot commented Oct 19, 2022

Codecov Report

Base: 70.96% // Head: 71.03% // Increases project coverage by +0.06% 🎉

Coverage data is based on head (aa82849) compared to base (0e20f50).
Patch coverage: 100.00% of modified lines in pull request are covered.

❗ Current head aa82849 differs from pull request most recent head e5b94fa. Consider uploading reports for the commit e5b94fa to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #837      +/-   ##
==========================================
+ Coverage   70.96%   71.03%   +0.06%     
==========================================
  Files          53       53              
  Lines        3699     3701       +2     
  Branches     2050     2052       +2     
==========================================
+ Hits         2625     2629       +4     
+ Misses       1072     1070       -2     
  Partials        2        2              
Impacted Files Coverage Δ
include/opds_dumper.h 100.00% <ø> (ø)
src/opds_dumper.cpp 99.18% <100.00%> (+0.01%) ⬆️
src/server/internalServer.cpp 88.51% <100.00%> (ø)
src/server/internalServer_catalog_v2.cpp 93.10% <100.00%> (ø)
include/name_mapper.h 100.00% <0.00%> (+28.57%) ⬆️

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

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

@@ -71,7 +72,7 @@ IllustrationInfo getBookIllustrationInfo(const Book& book)
return illustrations;
}

std::string fullEntryXML(const Book& book, const std::string& rootLocation)
std::string fullEntryXML(const Book& book, const std::string& rootLocation, const std::string& bookName)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We get back to #830 (comment):

bookName is not a good name for this new parameter (taking into account the line {"name", book.getName()}, below.

The easiest solution for this small PR is to pass into this function the NameMapper object instead.

Copy link
Member Author

@mgautierfr mgautierfr Oct 26, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about naming it contentId ?

test/library_server.cpp Outdated Show resolved Hide resolved
test/server.cpp Show resolved Hide resolved
Copy link
Collaborator

@veloman-yunkan veloman-yunkan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please rebase & fixup. No need to go through another iteration if you decide to address the last minor comment.

test/library_server.cpp Outdated Show resolved Hide resolved
@kelson42
Copy link
Collaborator

@mgautierfr I think @veloman-yunkan has invited us to merge straight.

@kelson42 kelson42 merged commit 8cc1c47 into master Oct 31, 2022
@kelson42 kelson42 deleted the opds_name_mapper_bis branch October 31, 2022 08:14
mgautierfr added a commit that referenced this pull request Nov 30, 2022
* [API Break] Remove wrapper around libzim (@mgautierfr #789)
* Allow kiwix-serve to use custom resource files (@veloman-yunkan #779)
* Properly handle searchProtocolPrefix when rendering search result (@veloman-yunkan #823)
* Prevent search on multi language content (@veloman-yunkan #838)
* Use new `zim::Archive::getMediaCount` from libzim (@mgautierfr #836)
* Catalog:
 - Include tags in free text catalog search (@veloman-yunkan #802)
 - Illustration's url is based on book's uuid (@veloman-yunkan #804)
 - Cleanup of the opds-dumper (@veloman-yunkan #829)
 - Allow filtering of catalog content using multiple languages (@veloman-yunkan #841)
 - Make opds-dumper respect the namemapper (@mgautierfr #837)
* Server:
 - Correctly handle `\` in suggestion json generation (@veloman-yunkan #843)
 - Better http caching (@veloman-yunkan #833)
 - Make `/suggest` endpoint thread-safe (@veloman-yunkan #834)
 - Better redirection of main page (@veloman-yunkan #827)
 - Remove jquery (@mgautierfr @juuz0 #796)
 - Better Viewer of zim content :
   . Introduce `/content` endpoints (@veloman-yunkan #806)
   . Switch to iframe based content viewer (@veloman-yunkan #716)
 - Optimised design of the welcome page:
   . Alignement (@juuz0 @kelson42 #786)
   . Exit download modal on pressing escape key (@Juzz0 #800)
   . Add favicon for different devices (@Juzz0 #805)
   . Fix auto hidding of the toolbar (@veloman-yunkan #821)
   . Allow user to filter books by tags in the front page (@juuz0 #711)
* CI :
  - Trigger CI on pull_request (@kelson42 #791)
  - Drop Ubuntu Impish packaging (@legoktm #825)
  - Add Ubuntu Kinetic packaging (@legoktm #801)
* Testing:
  - Test ICULanguageInfo (@veloman-yunkan #795)
  - Introduce fake `test` language to test i18n (@veloman-yunkan #848)
* Fix documentation (@kelson42 #816)
* Udpate translation (#787 #839 #847)
@mgautierfr mgautierfr mentioned this pull request Nov 30, 2022
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.

OPDS catalog must respect the used nameMapper
3 participants