Add opds image download
This commit is contained in:
@@ -197,6 +197,10 @@ void XMLCALL OpdsParser::startElement(void* userData, const XML_Char* name, cons
|
||||
}
|
||||
self->currentEntry.acquisitionLinks.push_back(acquisition);
|
||||
}
|
||||
} else if (rel && type && strstr(rel, "opds-spec.org/image") != nullptr &&
|
||||
strstr(rel, "thumbnail") == nullptr && strstr(type, "image/jpeg") != nullptr &&
|
||||
self->currentEntry.imageHref.empty()) {
|
||||
self->currentEntry.imageHref = href;
|
||||
} else if (type && strstr(type, "application/atom+xml") != nullptr) {
|
||||
if (self->currentEntry.type != OpdsEntryType::BOOK) {
|
||||
self->currentEntry.type = OpdsEntryType::NAVIGATION;
|
||||
|
||||
@@ -31,6 +31,7 @@ struct OpdsEntry {
|
||||
std::string href; // Navigation URL or epub download URL
|
||||
std::string id;
|
||||
std::vector<OpdsAcquisitionLink> acquisitionLinks;
|
||||
std::string imageHref; // Cover image URL (rel="http://opds-spec.org/image"), books only
|
||||
};
|
||||
|
||||
// Legacy alias for backward compatibility
|
||||
|
||||
Reference in New Issue
Block a user