mirror of https://github.com/kiwix/libkiwix.git
Store the size of the book in OPDSFeed.
This commit is contained in:
parent
ad69fdd8c0
commit
c66c7e9c20
|
@ -148,6 +148,7 @@ void Book::updateFromOpds(const pugi::xml_node& node)
|
|||
|
||||
if (rel == "http://opds-spec.org/acquisition/open-access") {
|
||||
m_url = linkNode.attribute("href").value();
|
||||
m_size = strtoull(linkNode.attribute("length").value(), 0, 0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -72,6 +72,7 @@ pugi::xml_node OPDSDumper::handleBook(Book book, pugi::xml_node root_node) {
|
|||
acquisition_link.append_attribute("rel") = "http://opds-spec.org/acquisition/open-access";
|
||||
acquisition_link.append_attribute("type") = "application/x-zim";
|
||||
acquisition_link.append_attribute("href") = book.getUrl().c_str();
|
||||
acquisition_link.append_attribute("length") = std::to_string(book.getSize()).c_str();
|
||||
}
|
||||
|
||||
if (! book.getFaviconMimeType().empty() ) {
|
||||
|
|
Loading…
Reference in New Issue