Skip to content

Conversation

@advokatb
Copy link
Contributor

@advokatb advokatb commented Dec 12, 2025

Changes

  • Added FB2 parser (src/fb2_parser.rs) to extract metadata from FB2 files
  • Extended book scanner to recognize and process .fb2 and .fb2.zip files
  • Updated file watcher to monitor FB2 files for changes
  • Updated CLI documentation to include FB2 in supported formats
  • Added required dependencies to Cargo.toml

Supported FB2 Features

  • Book title extraction
  • Author information
  • Description/metadata
  • Cover image extraction
  • Support for both .fb2 and .fb2.zip formats

Testing

  • FB2 files are recognized by the scanner
  • Metadata is correctly extracted from FB2 files
  • File watcher monitors FB2 files
  • No regressions in existing EPUB support

Notes

  • This PR adds support for FictionBook 2.0 (FB2) format, allowing users to include FB2 books in their KoShelf library alongside EPUB files.
  • Re-check the code, please. I didn't find any issues except that one book in fb2 format is not showing in Books section but it exists on disk
image

@paviro
Copy link
Owner

paviro commented Dec 12, 2025

Could you send me one book that shows up and the one that doesnt? Also if possible a metadata file generated by KoReader (koshelf@paviro.de)

- Added BookFormat enum with Epub and Fb2 variants
- BookFormat::from_path() detects format from extension (including .fb2.zip)
- BookFormat::metadata_filename() returns the correct KOReader metadata filename
- Replaced is_epub/is_fb2 booleans in book_scanner.rs with BookFormat
- Removed metadata fallback
- FB2 parser now handles .fb2.zip files by extracting from archive
- BookFormat::is_metadata_file() centralizes metadata file detection
- file_watcher uses BookFormat for cleaner file type detection
@paviro
Copy link
Owner

paviro commented Dec 12, 2025

All the books you send me work now. Also found a bug in the metadata parsing didn't support bookmarks yet as I have never used them haha.

@paviro paviro merged commit c11db9b into paviro:main Dec 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants