From 78083f1f4af5b40cce7ffb3206e9ccf170e605a9 Mon Sep 17 00:00:00 2001 From: Veloman Yunkan Date: Tue, 8 Jun 2021 16:18:28 +0400 Subject: [PATCH] Moved OPDS templates under static/templates --- src/opds_dumper.cpp | 6 +++--- src/server/internalServer_catalog_v2.cpp | 2 +- static/resources_list.txt | 8 ++++---- static/{ => templates}/catalog_entries.xml | 0 static/{ => templates}/catalog_v2_categories.xml | 0 static/{ => templates}/catalog_v2_entries.xml | 0 static/{ => templates}/catalog_v2_root.xml | 0 7 files changed, 8 insertions(+), 8 deletions(-) rename static/{ => templates}/catalog_entries.xml (100%) rename static/{ => templates}/catalog_v2_categories.xml (100%) rename static/{ => templates}/catalog_v2_entries.xml (100%) rename static/{ => templates}/catalog_v2_root.xml (100%) diff --git a/src/opds_dumper.cpp b/src/opds_dumper.cpp index dfba46b70..9d6fdfd5e 100644 --- a/src/opds_dumper.cpp +++ b/src/opds_dumper.cpp @@ -98,7 +98,7 @@ string OPDSDumper::dumpOPDSFeed(const std::vector& bookIds, const s {"books", bookData } }; - return render_template(RESOURCE::catalog_entries_xml, template_data); + return render_template(RESOURCE::templates::catalog_entries_xml, template_data); } string OPDSDumper::dumpOPDSFeedV2(const std::vector& bookIds, const std::string& query) const @@ -117,7 +117,7 @@ string OPDSDumper::dumpOPDSFeedV2(const std::vector& bookIds, const {"books", bookData } }; - return render_template(RESOURCE::catalog_v2_entries_xml, template_data); + return render_template(RESOURCE::templates::catalog_v2_entries_xml, template_data); } std::string OPDSDumper::categoriesOPDSFeed(const std::vector& categories) const @@ -135,7 +135,7 @@ std::string OPDSDumper::categoriesOPDSFeed(const std::vector& categ } return render_template( - RESOURCE::catalog_v2_categories_xml, + RESOURCE::templates::catalog_v2_categories_xml, kainjow::mustache::object{ {"date", now}, {"endpoint_root", rootLocation + "/catalog/v2"}, diff --git a/src/server/internalServer_catalog_v2.cpp b/src/server/internalServer_catalog_v2.cpp index 5a8827096..e7c05bac6 100644 --- a/src/server/internalServer_catalog_v2.cpp +++ b/src/server/internalServer_catalog_v2.cpp @@ -68,7 +68,7 @@ std::unique_ptr InternalServer::handle_catalog_v2_root(const RequestCo { return ContentResponse::build( *this, - RESOURCE::catalog_v2_root_xml, + RESOURCE::templates::catalog_v2_root_xml, kainjow::mustache::object{ {"date", gen_date_str()}, {"endpoint_root", m_root + "/catalog/v2"}, diff --git a/static/resources_list.txt b/static/resources_list.txt index dbeb5c5cd..025742834 100644 --- a/static/resources_list.txt +++ b/static/resources_list.txt @@ -36,9 +36,9 @@ templates/head_taskbar.html templates/taskbar_part.html templates/external_blocker_part.html templates/captured_external.html +templates/catalog_entries.xml +templates/catalog_v2_root.xml +templates/catalog_v2_entries.xml +templates/catalog_v2_categories.xml opensearchdescription.xml -catalog_entries.xml -catalog_v2_root.xml -catalog_v2_entries.xml -catalog_v2_categories.xml catalog_v2_searchdescription.xml diff --git a/static/catalog_entries.xml b/static/templates/catalog_entries.xml similarity index 100% rename from static/catalog_entries.xml rename to static/templates/catalog_entries.xml diff --git a/static/catalog_v2_categories.xml b/static/templates/catalog_v2_categories.xml similarity index 100% rename from static/catalog_v2_categories.xml rename to static/templates/catalog_v2_categories.xml diff --git a/static/catalog_v2_entries.xml b/static/templates/catalog_v2_entries.xml similarity index 100% rename from static/catalog_v2_entries.xml rename to static/templates/catalog_v2_entries.xml diff --git a/static/catalog_v2_root.xml b/static/templates/catalog_v2_root.xml similarity index 100% rename from static/catalog_v2_root.xml rename to static/templates/catalog_v2_root.xml