From 6f1799db9f9a97cf0d7b98f8080dd6a315e719f1 Mon Sep 17 00:00:00 2001 From: Matthieu Gautier Date: Wed, 17 Nov 2021 15:12:53 +0100 Subject: [PATCH] Use the new endpoint in the OPDS stream. --- src/opds_dumper.cpp | 7 ++++--- static/templates/catalog_v2_entry.xml | 4 ++-- test/server.cpp | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/opds_dumper.cpp b/src/opds_dumper.cpp index 229bc92e2..32d8010ec 100644 --- a/src/opds_dumper.cpp +++ b/src/opds_dumper.cpp @@ -59,10 +59,11 @@ IllustrationInfo getBookIllustrationInfo(const Book& book) kainjow::mustache::list illustrations; if ( book.isPathValid() ) { for ( const auto& illustration : book.getIllustrations() ) { + // For now, we are handling only sizexsize@1 illustration. + // So we can simply pass one size to mustache. illustrations.push_back(kainjow::mustache::object{ - {"icon_width", to_string(illustration->width)}, - {"icon_height", to_string(illustration->height)}, - {"icon_scale", "1"}, + {"icon_size", to_string(illustration->width)}, + {"icon_mimetype", illustration->mimeType} }); } } diff --git a/static/templates/catalog_v2_entry.xml b/static/templates/catalog_v2_entry.xml index 143872635..9f7df876a 100644 --- a/static/templates/catalog_v2_entry.xml +++ b/static/templates/catalog_v2_entry.xml @@ -16,8 +16,8 @@ {{article_count}} {{media_count}} {{#icons}} + href="{{root}}/catalog/v2/illustration/{{{content_id}}}/?size={{icon_size}}" + type="{{icon_mimetype}};width={{icon_size}};height={{icon_size}};scale=1"/> {{/icons}} {{author_name}} diff --git a/test/server.cpp b/test/server.cpp index 08eba5043..68a7ac07e 100644 --- a/test/server.cpp +++ b/test/server.cpp @@ -686,7 +686,7 @@ std::string maskVariableOPDSFeedData(std::string s) " 284\n" \ " 2\n" \ " \n" \ " \n" \ " \n" \