Use the new endpoint in the OPDS stream.

This commit is contained in:
Matthieu Gautier
2021-11-17 15:12:53 +01:00
parent e108fb0e47
commit 6f1799db9f
3 changed files with 7 additions and 6 deletions

View File

@ -59,10 +59,11 @@ IllustrationInfo getBookIllustrationInfo(const Book& book)
kainjow::mustache::list illustrations; kainjow::mustache::list illustrations;
if ( book.isPathValid() ) { if ( book.isPathValid() ) {
for ( const auto& illustration : book.getIllustrations() ) { 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{ illustrations.push_back(kainjow::mustache::object{
{"icon_width", to_string(illustration->width)}, {"icon_size", to_string(illustration->width)},
{"icon_height", to_string(illustration->height)}, {"icon_mimetype", illustration->mimeType}
{"icon_scale", "1"},
}); });
} }
} }

View File

@ -16,8 +16,8 @@
<articleCount>{{article_count}}</articleCount> <articleCount>{{article_count}}</articleCount>
<mediaCount>{{media_count}}</mediaCount> <mediaCount>{{media_count}}</mediaCount>
{{#icons}}<link rel="http://opds-spec.org/image/thumbnail" {{#icons}}<link rel="http://opds-spec.org/image/thumbnail"
href="{{root}}/meta?name=Illustration_{{icon_width}}x{{icon_height}}@{{icon_scale}}&amp;content={{{content_id}}}" href="{{root}}/catalog/v2/illustration/{{{content_id}}}/?size={{icon_size}}"
type="image/png;width={{icon_width}};height={{icon_height}};scale={{icon_scale}}"/> type="{{icon_mimetype}};width={{icon_size}};height={{icon_size}};scale=1"/>
{{/icons}}<link type="text/html" href="{{root}}/{{{content_id}}}" /> {{/icons}}<link type="text/html" href="{{root}}/{{{content_id}}}" />
<author> <author>
<name>{{author_name}}</name> <name>{{author_name}}</name>

View File

@ -686,7 +686,7 @@ std::string maskVariableOPDSFeedData(std::string s)
" <articleCount>284</articleCount>\n" \ " <articleCount>284</articleCount>\n" \
" <mediaCount>2</mediaCount>\n" \ " <mediaCount>2</mediaCount>\n" \
" <link rel=\"http://opds-spec.org/image/thumbnail\"\n" \ " <link rel=\"http://opds-spec.org/image/thumbnail\"\n" \
" href=\"/ROOT/meta?name=Illustration_48x48@1&amp;content=zimfile\"\n" \ " href=\"/ROOT/catalog/v2/illustration/zimfile/?size=48\"\n" \
" type=\"image/png;width=48;height=48;scale=1\"/>\n" \ " type=\"image/png;width=48;height=48;scale=1\"/>\n" \
" <link type=\"text/html\" href=\"/ROOT/zimfile\" />\n" \ " <link type=\"text/html\" href=\"/ROOT/zimfile\" />\n" \
" <author>\n" \ " <author>\n" \