Correctly set the id of the opds stream.

Set the id of the stream *after* the uuid is generated.
This commit is contained in:
Matthieu Gautier 2020-01-07 17:06:12 +01:00
parent 8095a87bf1
commit 4a01303438
2 changed files with 6 additions and 1 deletions

View File

@ -1,3 +1,8 @@
kiwix-lib 8.2.3
===============
* [OPDS] Correctly set the id of the OPDS stream.
kiwix-lib 8.2.2
===============

View File

@ -742,7 +742,6 @@ Response InternalServer::handle_catalog(const RequestContext& request)
kiwix::OPDSDumper opdsDumper;
opdsDumper.setRootLocation(m_root);
opdsDumper.setSearchDescriptionUrl("catalog/searchdescription.xml");
opdsDumper.setId(kiwix::to_string(uuid));
opdsDumper.setLibrary(mp_library);
response.set_mimeType("application/atom+xml;profile=opds-catalog;kind=acquisition; charset=utf-8");
std::vector<std::string> bookIdsToDump;
@ -792,6 +791,7 @@ Response InternalServer::handle_catalog(const RequestContext& request)
opdsDumper.setOpenSearchInfo(totalResults, startIndex, bookIdsToDump.size());
}
opdsDumper.setId(kiwix::to_string(uuid));
response.set_content(opdsDumper.dumpOPDSFeed(bookIdsToDump));
return response;
}