Allow a OPDSDumper to dump only a subset of the library.

This commit is contained in:
Matthieu Gautier 2018-09-06 18:54:17 +02:00
parent 5128861136
commit 996829e4d7
2 changed files with 4 additions and 4 deletions

View File

@ -54,7 +54,7 @@ class OPDSDumper
* @param id The id of the library. * @param id The id of the library.
* @return The OPDS feed. * @return The OPDS feed.
*/ */
std::string dumpOPDSFeed(); std::string dumpOPDSFeed(const std::vector<std::string>& bookIds);
/** /**
* Set the id of the opds stream. * Set the id of the opds stream.

View File

@ -83,7 +83,7 @@ pugi::xml_node OPDSDumper::handleBook(Book book, pugi::xml_node root_node) {
return entry_node; return entry_node;
} }
string OPDSDumper::dumpOPDSFeed() string OPDSDumper::dumpOPDSFeed(const std::vector<std::string>& bookIds)
{ {
date = gen_date_str(); date = gen_date_str();
pugi::xml_document doc; pugi::xml_document doc;
@ -111,8 +111,8 @@ string OPDSDumper::dumpOPDSFeed()
} }
if (library) { if (library) {
for (auto& pair: library->books) { for (auto& bookId: bookIds) {
handleBook(pair.second, root_node); handleBook(library->getBookById(bookId), root_node);
} }
} }