diff --git a/src/opds_dumper.cpp b/src/opds_dumper.cpp index 67fe91eb..d1c85dca 100644 --- a/src/opds_dumper.cpp +++ b/src/opds_dumper.cpp @@ -99,10 +99,12 @@ kainjow::mustache::object getSingleBookData(const Book& book) std::string getSingleBookEntryXML(const Book& book, const std::string& rootLocation, const std::string& endpointRoot, bool partial) { auto data = getSingleBookData(book); - data["dump_partial_entries"] = MustacheData(partial); data["endpoint_root"] = endpointRoot; data["root"] = rootLocation; - return render_template(RESOURCE::templates::catalog_v2_entry_xml, data); + const auto xmlTemplate = partial + ? RESOURCE::templates::catalog_v2_partial_entry_xml + : RESOURCE::templates::catalog_v2_entry_xml; + return render_template(xmlTemplate, data); } BooksData getBooksData(const Library* library, const std::vector& bookIds, const std::string& rootLocation, const std::string& endpointRoot, bool partial) diff --git a/static/resources_list.txt b/static/resources_list.txt index 4ff6cc3c..2730f1b2 100644 --- a/static/resources_list.txt +++ b/static/resources_list.txt @@ -27,6 +27,7 @@ templates/catalog_entries.xml templates/catalog_v2_root.xml templates/catalog_v2_entries.xml templates/catalog_v2_entry.xml +templates/catalog_v2_partial_entry.xml templates/catalog_v2_categories.xml templates/catalog_v2_languages.xml templates/url_of_search_results_css diff --git a/static/templates/catalog_v2_entry.xml b/static/templates/catalog_v2_entry.xml index 4e53f712..f7c11f1f 100644 --- a/static/templates/catalog_v2_entry.xml +++ b/static/templates/catalog_v2_entry.xml @@ -2,11 +2,7 @@ urn:uuid:{{id}} {{title}} {{updated}} -{{#dump_partial_entries}} - -{{/dump_partial_entries}}{{^dump_partial_entries}} {{description}} + {{description}} {{language}} {{name}} {{flavour}} @@ -28,5 +24,4 @@ {{#url}} {{/url}} -{{/dump_partial_entries}} diff --git a/static/templates/catalog_v2_partial_entry.xml b/static/templates/catalog_v2_partial_entry.xml new file mode 100644 index 00000000..f3dc56b1 --- /dev/null +++ b/static/templates/catalog_v2_partial_entry.xml @@ -0,0 +1,8 @@ + + urn:uuid:{{id}} + {{title}} + {{updated}} + +