Update lib/Epub/Epub/parsers/ContentOpfParser.cpp

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
Arthur Tazhitdinov 2025-12-16 18:14:45 +03:00 committed by GitHub
parent b540fbc6fd
commit 2527f2f3a5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -126,7 +126,11 @@ void XMLCALL ContentOpfParser::startElement(void* userData, const XML_Char* name
self->items[itemId] = href; self->items[itemId] = href;
if (mediaType == "application/x-dtbncx+xml") { if (mediaType == "application/x-dtbncx+xml") {
self->tocNcxPath = href; if (self->tocNcxPath.empty()) {
self->tocNcxPath = href;
} else {
Serial.printf("[%lu] [COF] Warning: Multiple NCX files found in manifest. Ignoring duplicate: %s\n", millis(), href.c_str());
}
} }
return; return;
} }