diff --git a/include/opds_dumper.h b/include/opds_dumper.h index 0a70b65d5..69c74e753 100644 --- a/include/opds_dumper.h +++ b/include/opds_dumper.h @@ -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& categories) const; + std::string categoriesOPDSFeed() const; /** * Dump the languages OPDS feed. diff --git a/src/opds_dumper.cpp b/src/opds_dumper.cpp index 68bffbe13..373921686 100644 --- a/src/opds_dumper.cpp +++ b/src/opds_dumper.cpp @@ -140,11 +140,11 @@ string OPDSDumper::dumpOPDSFeedV2(const std::vector& bookIds, const return render_template(RESOURCE::templates::catalog_v2_entries_xml, template_data); } -std::string OPDSDumper::categoriesOPDSFeed(const std::vector& 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}, diff --git a/src/server/internalServer_catalog_v2.cpp b/src/server/internalServer_catalog_v2.cpp index 3d79111a3..9dc88b49c 100644 --- a/src/server/internalServer_catalog_v2.cpp +++ b/src/server/internalServer_catalog_v2.cpp @@ -104,7 +104,7 @@ std::unique_ptr 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" ); }