Store the size of the book in OPDSFeed.

This commit is contained in:
Matthieu Gautier 2018-10-19 11:48:38 +02:00
parent ad69fdd8c0
commit c66c7e9c20
2 changed files with 2 additions and 0 deletions

View File

@ -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;
}
}

View File

@ -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() ) {