mirror of
https://github.com/kiwix/libkiwix.git
synced 2025-06-26 10:11:30 +00:00
Use the new endpoint in the OPDS stream.
This commit is contained in:
@ -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"},
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -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}}&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>
|
||||||
|
@ -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&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" \
|
||||||
|
Reference in New Issue
Block a user