Skip to content

Conversation

@balazs-szucs
Copy link
Collaborator

🚀 Pull Request

📝 Description

Closes: #2041

IANA deprecated the mimetypes "application/x-cbr" and "application/x-cbz" in 2017 and replaced them with "application/vnd.comicbook-rar" and "application/vnd.comicbook+zip". Newer readers may not recognize the deprecated mimetypes.

This pull request improves how file MIME types are determined and represented for books in the OPDS feed, ensuring they are accurate and standards-compliant. It also introduces comprehensive tests to verify correct MIME type assignment for various book formats.

🛠️ Changes Implemented

MIME type handling improvements:

  • The fileMimeType method in OpdsFeedService.java now returns fully qualified MIME types (e.g., "application/pdf", "application/epub+zip", etc.) instead of partial or incorrect strings, and provides specific MIME types for additional formats like FB2 and various comic book archives (CBZ, CBR, CB7, CBT).
  • The appendLinks method is updated to use the correct MIME type directly, removing the redundant "application/" prefix that was previously prepended.

Testing improvements:

  • Added a new test class OpdsFeedServiceMimeTypeTest.java that thoroughly tests MIME type assignment for all supported book file types, including edge cases for comic book archive extensions.

🧪 Testing Strategy

📸 Visual Changes (if applicable)

⚠️ Required Pre-Submission Checklist

  • Code adheres to project style guidelines and conventions
  • Branch synchronized with latest develop branch
  • Automated unit/integration tests added/updated to cover changes
  • All tests pass locally (./gradlew test for backend)
  • Manual testing completed in local development environment
  • Flyway migration versioning follows correct sequence (if database schema modified)
  • Documentation pull request submitted to booklore-docs (required for features or enhancements that introduce user-facing or visual changes)

💬 Additional Context (optional)

…e extension

Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>
…n feed links

Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>
…llback

Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>
…eed generation

Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>
@balazs-szucs balazs-szucs changed the title fix(opds): add mime type support for FB2 and CBX formats based on file extension fix(opds): update mime type support for FB2 and CBX formats based on file extension Dec 31, 2025
@acx10 acx10 added the bug Something isn't working label Jan 1, 2026
@acx10 acx10 merged commit b31012c into booklore-app:develop Jan 1, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] Serve CBX as CBX with OPDS

2 participants