From 996829e4d7e8efcf54e320ff76e46568d70f954d Mon Sep 17 00:00:00 2001 From: Matthieu Gautier Date: Thu, 6 Sep 2018 18:54:17 +0200 Subject: [PATCH] Allow a OPDSDumper to dump only a subset of the library. --- include/opds_dumper.h | 2 +- src/opds_dumper.cpp | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/opds_dumper.h b/include/opds_dumper.h index 7d3ae9b6a..ebfa4f8df 100644 --- a/include/opds_dumper.h +++ b/include/opds_dumper.h @@ -54,7 +54,7 @@ class OPDSDumper * @param id The id of the library. * @return The OPDS feed. */ - std::string dumpOPDSFeed(); + std::string dumpOPDSFeed(const std::vector& bookIds); /** * Set the id of the opds stream. diff --git a/src/opds_dumper.cpp b/src/opds_dumper.cpp index e99d1f61d..5caf2892a 100644 --- a/src/opds_dumper.cpp +++ b/src/opds_dumper.cpp @@ -83,7 +83,7 @@ pugi::xml_node OPDSDumper::handleBook(Book book, pugi::xml_node root_node) { return entry_node; } -string OPDSDumper::dumpOPDSFeed() +string OPDSDumper::dumpOPDSFeed(const std::vector& bookIds) { date = gen_date_str(); pugi::xml_document doc; @@ -111,8 +111,8 @@ string OPDSDumper::dumpOPDSFeed() } if (library) { - for (auto& pair: library->books) { - handleBook(pair.second, root_node); + for (auto& bookId: bookIds) { + handleBook(library->getBookById(bookId), root_node); } }