Skip to content

Commit

Permalink
OPDSDumper::categoriesOPDSFeed() with no args
Browse files Browse the repository at this point in the history
  • Loading branch information
veloman-yunkan authored and kelson42 committed Jul 31, 2021
1 parent 083b170 commit 89e0958
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
3 changes: 1 addition & 2 deletions include/opds_dumper.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,9 @@ class OPDSDumper
/**
* Dump the categories OPDS feed.
*
* @param categories list of category names
* @return The OPDS feed.
*/
std::string categoriesOPDSFeed(const std::vector<std::string>& categories) const;
std::string categoriesOPDSFeed() const;

/**
* Dump the languages OPDS feed.
Expand Down
4 changes: 2 additions & 2 deletions src/opds_dumper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,11 +140,11 @@ string OPDSDumper::dumpOPDSFeedV2(const std::vector<std::string>& bookIds, const
return render_template(RESOURCE::templates::catalog_v2_entries_xml, template_data);
}

std::string OPDSDumper::categoriesOPDSFeed(const std::vector<std::string>& categories) const
std::string OPDSDumper::categoriesOPDSFeed() const
{
const auto now = gen_date_str();
kainjow::mustache::list categoryData;
for ( const auto& category : categories ) {
for ( const auto& category : library->getBooksCategories() ) {
const auto urlencodedCategoryName = urlEncode(category);
categoryData.push_back(kainjow::mustache::object{
{"name", category},
Expand Down
2 changes: 1 addition & 1 deletion src/server/internalServer_catalog_v2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ std::unique_ptr<Response> InternalServer::handle_catalog_v2_categories(const Req
opdsDumper.setLibraryId(m_library_id);
return ContentResponse::build(
*this,
opdsDumper.categoriesOPDSFeed(mp_library->getBooksCategories()),
opdsDumper.categoriesOPDSFeed(),
"application/atom+xml;profile=opds-catalog;kind=navigation"
);
}
Expand Down

0 comments on commit 89e0958

Please sign in to comment.