mirror of https://github.com/kiwix/libkiwix.git
Use the new endpoint in the OPDS stream.
This commit is contained in:
parent
e108fb0e47
commit
6f1799db9f
|
@ -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}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -16,8 +16,8 @@
|
|||
<articleCount>{{article_count}}</articleCount>
|
||||
<mediaCount>{{media_count}}</mediaCount>
|
||||
{{#icons}}<link rel="http://opds-spec.org/image/thumbnail"
|
||||
href="{{root}}/meta?name=Illustration_{{icon_width}}x{{icon_height}}@{{icon_scale}}&content={{{content_id}}}"
|
||||
type="image/png;width={{icon_width}};height={{icon_height}};scale={{icon_scale}}"/>
|
||||
href="{{root}}/catalog/v2/illustration/{{{content_id}}}/?size={{icon_size}}"
|
||||
type="{{icon_mimetype}};width={{icon_size}};height={{icon_size}};scale=1"/>
|
||||
{{/icons}}<link type="text/html" href="{{root}}/{{{content_id}}}" />
|
||||
<author>
|
||||
<name>{{author_name}}</name>
|
||||
|
|
|
@ -686,7 +686,7 @@ std::string maskVariableOPDSFeedData(std::string s)
|
|||
" <articleCount>284</articleCount>\n" \
|
||||
" <mediaCount>2</mediaCount>\n" \
|
||||
" <link rel=\"http://opds-spec.org/image/thumbnail\"\n" \
|
||||
" href=\"/ROOT/meta?name=Illustration_48x48@1&content=zimfile\"\n" \
|
||||
" href=\"/ROOT/catalog/v2/illustration/zimfile/?size=48\"\n" \
|
||||
" type=\"image/png;width=48;height=48;scale=1\"/>\n" \
|
||||
" <link type=\"text/html\" href=\"/ROOT/zimfile\" />\n" \
|
||||
" <author>\n" \
|
||||
|
|
Loading…
Reference in New Issue