Skip to content

feat(opds): Add option to skip metadata feed for direct access#1879

Open
zeedif wants to merge 3 commits intoSuwayomi:masterfrom
zeedif:feat/opds-skip-metadata
Open

feat(opds): Add option to skip metadata feed for direct access#1879
zeedif wants to merge 3 commits intoSuwayomi:masterfrom
zeedif:feat/opds-skip-metadata

Conversation

@zeedif
Copy link
Contributor

@zeedif zeedif commented Jan 27, 2026

This PR adds a configuration option, server.opdsSkipChapterMetadataFeed, to allow the chapter list to handle everything the metadata feed used to do. Instead of having to tap into each chapter to find the download or stream links, they are now available directly in the main list. This is a big quality-of-life improvement for KOReader users or anyone using automated downloaders.

What’s changed?

1. Optimization and Logic Cleanup

  • ChapterForDownload.kt: I've extracted some of the internal logic (updateChapterPersistence and refreshChapterPageList) to make it reusable. This allows the server to verify local files and update database page counts in bulk much more efficiently, without relying on the full download-ready flow.

2. Making the Chapter List "Smarter"

  • ChapterRepository.kt: When the "skip metadata" flag is on, the repository now enriches the chapter list asynchronously. It checks the download status, fixes DB mismatches on the fly, and calculates the CBZ file size. This way, the list has all the info it needs (like the "Downloaded" status and size) without needing a sub-feed.
  • OpdsEntryBuilder.kt: I moved the logic that generates download (CBZ) and stream (OPDS-PSE) links so it can be injected directly into the chapter list entries. I also moved the visual state indicators (like the "Downloaded" icon) to the list titles.

3. KoSync Integration

  • I’ve integrated KoSync directly into the chapter list. It now checks for remote progress while generating the list.
  • Since we lose the "Metadata" screen where a user could manually resolve a conflict, I’ve made it non-blocking: it applies updates if the strategy says so, but if it's set to PROMPT, it just stays quiet and uses the local progress to keep the feed moving.

4. Configuration and DTOs

  • Added the new setting to ServerConfig.kt (ProtoNumber 86).
  • Updated the DTOs (OpdsChapterListAcqEntry and OpdsChapterMetadataAcqEntry) to carry the downloaded status and cbzFileSize info.
  • Added a note in Configuring-Suwayomi-Server.md about how this affects syncing.

Why do this?

It saves a lot of navigation. Instead of Chapter List -> Metadata Feed -> Download, it’s just Chapter List -> Download. It makes the whole OPDS integration feel more responsive and works much better with tools that try to index or bulk-download chapters.

Introduces a new server configuration `server.opdsSkipChapterMetadataFeed` (default: false).

When enabled, the OPDS chapter feed generates direct acquisition (CBZ download) and streaming (OPDS-PSE) links within the chapter list entries, bypassing the intermediate metadata subsection. This streamlines the user experience and improves compatibility with OPDS clients like KOReader that rely on direct links for automated downloading features.
…a mode

Refines the `opdsSkipChapterMetadataFeed` implementation to ensure necessary data is available for direct links and handles synchronization logic appropriate for a list view.

- **Refactor ChapterForDownload:** Extract `refreshChapterPageList` and `updateChapterPersistence` to allow reusing page count verification logic outside the download flow.
- **Enrich Chapter Repository:** When skipping metadata, asynchronously verify page counts and calculate CBZ file sizes for chapters in the list. This ensures direct stream/download links are valid even if the chapter wasn't previously fully indexed.
- **KoSync Logic:** Implement synchronization logic in `OpdsEntryBuilder`. Since the user cannot be prompted in the chapter list view, `PROMPT` conflicts are explicitly ignored (prioritizing local progress), while updates are applied if non-conflicting.
- **OPDS Attributes:** Add `length` (file size) to acquisition links and ensure download links only appear for actually downloaded chapters.
- **Documentation:** Update `server.conf` description to clarify KoSync behavior in this mode.
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.

1 participant

Comments