Skip to content

fix(opds): support mixed feed items parsing#16

Merged
chrox merged 1 commit into
readest:mainfrom
zeedif:patch-3
Apr 28, 2026
Merged

fix(opds): support mixed feed items parsing#16
chrox merged 1 commit into
readest:mainfrom
zeedif:patch-3

Conversation

@zeedif

@zeedif zeedif commented Apr 27, 2026

Copy link
Copy Markdown

This is a follow-up to PR #14 to refine the handling of mixed OPDS feeds.

What's changed

  • Robust Feed Separation: Even though the OPDS 1.2 spec implicitly states that a feed should be strictly either Acquisition or Navigation, some servers (like Copyparty) send mixed feeds containing both books and folders in the same response. I've modified the getFeed parsing logic to intelligently segregate publications and navigation arrays on a per-item basis instead of relying entirely on the very first entry. This restores support for such non-standard yet practical implementations found in the wild.

@chrox

chrox commented Apr 27, 2026

Copy link
Copy Markdown
Collaborator

Please test and make sure it works as expected at least for:

  • Calibre / CWA
  • Project Gutenberg
  • Standard Ebooks
  • ManyBooks

@zeedif

zeedif commented Apr 27, 2026

Copy link
Copy Markdown
Author

@chrox I have tested the changes against the standard OPDS catalogs (Project Gutenberg, Standard Ebooks and ManyBooks), and the parser continues to work as expected for all of them.

The original code determined the type of the entire array based solely on the first item (items[0]?.metadata ? 'publications' : 'navigation'). For standard, homogeneous feeds, this PR behaves exactly the same as before, placing all items exclusively into either publications or navigation. However, for mixed feeds, it now evaluates each item individually to separate them correctly.

I suggested this change specifically because Readest already evaluates this mixed-feed scenario (like Copyparty) in its test suite, specifically in apps\readest-app\src\__tests__\utils\opds-feed.test.ts.

I leave the videos below demonstrating that Readest works exactly the same with these catalogs after the changes.

  • Project Gutenberg
Grabacion.2026-04-27.111218.mp4
  • Standard Ebooks
Grabacion.2026-04-27.111312.mp4
  • ManyBooks
Grabacion.2026-04-27.111403.mp4

@chrox

chrox commented Apr 28, 2026

Copy link
Copy Markdown
Collaborator

Looks great. Thanks.

@chrox chrox merged commit 450a7f0 into readest:main Apr 28, 2026
2 checks passed
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