Parse the author name from content.opf file (#165)

## Summary

* Parse the author name from content.opf file
  * Listed in the dc:creator tag within the metadata section
This commit is contained in:
Dave Allie
2025-12-30 21:15:44 +10:00
committed by GitHub
parent 3dd52f30fa
commit be1b5bad21
4 changed files with 28 additions and 2 deletions

View File

@@ -72,8 +72,7 @@ bool Epub::parseContentOpf(BookMetadataCache::BookMetadata& bookMetadata) {
// Grab data from opfParser into epub
bookMetadata.title = opfParser.title;
// TODO: Parse author
bookMetadata.author = "";
bookMetadata.author = opfParser.author;
bookMetadata.coverItemHref = opfParser.coverItemHref;
if (!opfParser.tocNcxPath.empty()) {
@@ -253,6 +252,15 @@ const std::string& Epub::getTitle() const {
return bookMetadataCache->coreMetadata.title;
}
const std::string& Epub::getAuthor() const {
static std::string blank;
if (!bookMetadataCache || !bookMetadataCache->isLoaded()) {
return blank;
}
return bookMetadataCache->coreMetadata.author;
}
std::string Epub::getCoverBmpPath() const { return cachePath + "/cover.bmp"; }
bool Epub::generateCoverBmp() const {