Skip to content

Commit fd73bf1

Browse files
committed
fix(komga): fix EPUB manifest metadata serialization breaking Komic TOC display
Rust's Decimal type serializes as a JSON string ("1") rather than a number (1), which caused Readium's strict metadata parser to silently reject the entire manifest in Komic, preventing the table of contents from displaying. Key changes: - Convert Decimal position to f64/i64 before JSON serialization to emit numbers - Build absolute URLs using X-Forwarded-Proto/Host headers for reverse proxy support - Add belongsTo (series info), language, modified, ISBN identifier to metadata - Add /manifest route alias alongside /manifest/epub (Komga serves both) - Add thumbnail entry to resources list - Rewrite NCX parser with proper navPoint depth tracking via find_closing_nav_point - Add NCX fallback discovery by well-known item IDs (toc, ncx, ncxtoc) - Add EPUB 3 nav document parser for modern EPUBs - Add tests for NCX parsing (flat, nested, real EPUB)
1 parent d695990 commit fd73bf1

3 files changed

Lines changed: 363 additions & 78 deletions

File tree

src/api/routes/komga/dto/manifest.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ use utoipa::ToSchema;
1010
///
1111
/// Root structure for the manifest returned by the EPUB manifest endpoint.
1212
/// Matches Komga's WebPub Manifest output for maximum compatibility.
13+
#[allow(dead_code)]
1314
#[derive(Debug, Serialize, ToSchema)]
1415
pub struct WebPubManifest {
1516
pub context: String,
@@ -26,6 +27,7 @@ pub struct WebPubManifest {
2627
}
2728

2829
/// Metadata section of the WebPub Manifest
30+
#[allow(dead_code)]
2931
#[derive(Debug, Serialize, ToSchema)]
3032
pub struct WebPubMetadata {
3133
pub identifier: String,
@@ -44,6 +46,7 @@ pub struct WebPubMetadata {
4446
}
4547

4648
/// Rendition properties for EPUB layout
49+
#[allow(dead_code)]
4750
#[derive(Debug, Serialize, ToSchema)]
4851
pub struct WebPubRendition {
4952
pub layout: String,

0 commit comments

Comments
 (0)