Enter Book::getIllustrations()

This commit is contained in:
Veloman Yunkan
2021-11-18 14:25:03 +04:00
parent e2544799a1
commit eb6a0d6456
3 changed files with 13 additions and 4 deletions

View File

@ -47,6 +47,11 @@ Book::~Book()
{
}
Book::Illustrations Book::getIllustrations() const
{
return m_illustrations;
}
bool Book::update(const kiwix::Book& other)
{
if (m_readOnly)

View File

@ -58,10 +58,10 @@ IllustrationInfo getBookIllustrationInfo(const Book& book)
{
kainjow::mustache::list illustrations;
if ( book.isPathValid() ) {
for ( auto illustration_size : zim::Archive(book.getPath()).getIllustrationSizes() ) {
for ( const auto& illustration : book.getIllustrations() ) {
illustrations.push_back(kainjow::mustache::object{
{"icon_width", to_string(illustration_size)},
{"icon_height", to_string(illustration_size)},
{"icon_width", to_string(illustration->width)},
{"icon_height", to_string(illustration->height)},
{"icon_scale", "1"},
});
}