diff --git a/src/html_dumper.cpp b/src/html_dumper.cpp index ce610dc4..b91e34d9 100644 --- a/src/html_dumper.cpp +++ b/src/html_dumper.cpp @@ -130,7 +130,7 @@ std::string HTMLDumper::dumpPlainHTML(kiwix::Filter filter) const RESOURCE::templates::no_js_library_page_html, kainjow::mustache::object{ {"root", rootLocation}, - {"contentServerUrl", onlyAsNonEmptyMustacheValue(contentServerUrl)}, + {"contentAccessUrl", onlyAsNonEmptyMustacheValue(contentAccessUrl)}, {"books", booksData }, {"searchQuery", searchQuery}, {"languages", languages}, diff --git a/src/library_dumper.h b/src/library_dumper.h index 880836c7..2d7f350a 100644 --- a/src/library_dumper.h +++ b/src/library_dumper.h @@ -51,11 +51,11 @@ class LibraryDumper void setRootLocation(const std::string& rootLocation) { this->rootLocation = rootLocation; } /** - * Set the URL of the content server. + * Set the URL for accessing book content * - * @param url the URL of the content server to use. + * @param url the URL of the /content endpoint of the content server */ - void setContentServerUrl(const std::string& url) { this->contentServerUrl = url; } + void setContentAccessUrl(const std::string& url) { this->contentAccessUrl = url; } /** * Set some informations about the search results. @@ -88,7 +88,7 @@ class LibraryDumper const kiwix::NameMapper* const nameMapper; std::string libraryId; std::string rootLocation; - std::string contentServerUrl; + std::string contentAccessUrl; std::string m_userLang; int m_totalResults; int m_startIndex; diff --git a/src/opds_dumper.cpp b/src/opds_dumper.cpp index bd4c1573..a8e8ee2b 100644 --- a/src/opds_dumper.cpp +++ b/src/opds_dumper.cpp @@ -64,13 +64,13 @@ IllustrationInfo getBookIllustrationInfo(const Book& book) std::string fullEntryXML(const Book& book, const std::string& rootLocation, - const std::string& contentServerUrl, + const std::string& contentAccessUrl, const std::string& contentId) { const auto bookDate = book.getDate() + "T00:00:00Z"; const kainjow::mustache::object data{ {"root", rootLocation}, - {"contentServerUrl", onlyAsNonEmptyMustacheValue(contentServerUrl)}, + {"contentAccessUrl", onlyAsNonEmptyMustacheValue(contentAccessUrl)}, {"id", book.getId()}, {"name", book.getName()}, {"title", book.getTitle()}, @@ -111,7 +111,7 @@ BooksData getBooksData(const Library* library, const NameMapper* nameMapper, const std::vector& bookIds, const std::string& rootLocation, - const std::string& contentServerUrl, + const std::string& contentAccessUrl, bool partial) { BooksData booksData; @@ -121,7 +121,7 @@ BooksData getBooksData(const Library* library, const std::string contentId = nameMapper->getNameForId(bookId); const auto entryXML = partial ? partialEntryXML(book, rootLocation) - : fullEntryXML(book, rootLocation, contentServerUrl, contentId); + : fullEntryXML(book, rootLocation, contentAccessUrl, contentId); booksData.push_back(kainjow::mustache::object{ {"entry", entryXML} }); } catch ( const std::out_of_range& ) { // the book was removed from the library since its id was obtained @@ -136,7 +136,7 @@ BooksData getBooksData(const Library* library, string OPDSDumper::dumpOPDSFeed(const std::vector& bookIds, const std::string& query) const { - const auto booksData = getBooksData(library, nameMapper, bookIds, rootLocation, contentServerUrl, false); + const auto booksData = getBooksData(library, nameMapper, bookIds, rootLocation, contentAccessUrl, false); const kainjow::mustache::object template_data{ {"date", gen_date_str()}, {"root", rootLocation}, @@ -154,7 +154,7 @@ string OPDSDumper::dumpOPDSFeed(const std::vector& bookIds, const s string OPDSDumper::dumpOPDSFeedV2(const std::vector& bookIds, const std::string& query, bool partial) const { const auto endpointRoot = rootLocation + "/catalog/v2"; - const auto booksData = getBooksData(library, nameMapper, bookIds, rootLocation, contentServerUrl, partial); + const auto booksData = getBooksData(library, nameMapper, bookIds, rootLocation, contentAccessUrl, partial); const char* const endpoint = partial ? "/partial_entries" : "/entries"; const std::string url = endpoint + (query.empty() ? "" : "?" + query); @@ -179,7 +179,7 @@ std::string OPDSDumper::dumpOPDSCompleteEntry(const std::string& bookId) const const std::string contentId = nameMapper->getNameForId(bookId); return XML_HEADER + "\n" - + fullEntryXML(book, rootLocation, contentServerUrl, contentId); + + fullEntryXML(book, rootLocation, contentAccessUrl, contentId); } std::string OPDSDumper::categoriesOPDSFeed() const diff --git a/src/server/internalServer.cpp b/src/server/internalServer.cpp index 73d23a55..89618a13 100644 --- a/src/server/internalServer.cpp +++ b/src/server/internalServer.cpp @@ -858,9 +858,9 @@ std::unique_ptr InternalServer::handle_no_js(const RequestContext& req htmlDumper.setRootLocation(m_root); htmlDumper.setLibraryId(getLibraryId()); if ( !m_contentServerUrl.empty() ) { - htmlDumper.setContentServerUrl(m_contentServerUrl + "/content"); + htmlDumper.setContentAccessUrl(m_contentServerUrl + "/content"); } else if ( !m_catalogOnlyMode ) { - htmlDumper.setContentServerUrl(m_root + "/content"); + htmlDumper.setContentAccessUrl(m_root + "/content"); } auto userLang = request.get_user_language(); htmlDumper.setUserLanguage(userLang); diff --git a/src/server/internalServer_catalog.cpp b/src/server/internalServer_catalog.cpp index 69270f30..0e6dd2c1 100644 --- a/src/server/internalServer_catalog.cpp +++ b/src/server/internalServer_catalog.cpp @@ -57,9 +57,9 @@ OPDSDumper InternalServer::getOPDSDumper() const opdsDumper.setRootLocation(m_root); opdsDumper.setLibraryId(getLibraryId()); if ( !m_contentServerUrl.empty() ) { - opdsDumper.setContentServerUrl(m_contentServerUrl + "/content"); + opdsDumper.setContentAccessUrl(m_contentServerUrl + "/content"); } else if ( !m_catalogOnlyMode ) { - opdsDumper.setContentServerUrl(m_root + "/content"); + opdsDumper.setContentAccessUrl(m_root + "/content"); } return opdsDumper; } diff --git a/static/templates/catalog_v2_entry.xml b/static/templates/catalog_v2_entry.xml index 700d51f3..af15a8cd 100644 --- a/static/templates/catalog_v2_entry.xml +++ b/static/templates/catalog_v2_entry.xml @@ -13,8 +13,8 @@ {{#icons}} - {{/icons}}{{#contentServerUrl}} - {{/contentServerUrl}} + {{/icons}}{{#contentAccessUrl}} + {{/contentAccessUrl}} {{author_name}} diff --git a/static/templates/no_js_library_page.html b/static/templates/no_js_library_page.html index c1db3b01..829259f3 100644 --- a/static/templates/no_js_library_page.html +++ b/static/templates/no_js_library_page.html @@ -107,7 +107,7 @@ {{translations.count-of-matching-books}} {{#books}} - {{#contentServerUrl}}{{/contentServerUrl}} + {{#contentAccessUrl}}{{/contentAccessUrl}} @@ -115,7 +115,7 @@ {{description}} - {{#contentServerUrl}}{{/contentServerUrl}} + {{#contentAccessUrl}}{{/contentAccessUrl}} {{langTag.langShortString}}