feat(opds): Add option to skip metadata feed for direct access#1879
Open
zeedif wants to merge 3 commits intoSuwayomi:masterfrom
Open
feat(opds): Add option to skip metadata feed for direct access#1879zeedif wants to merge 3 commits intoSuwayomi:masterfrom
zeedif wants to merge 3 commits intoSuwayomi:masterfrom
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 (updateChapterPersistenceandrefreshChapterPageList) 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
PROMPT, it just stays quiet and uses the local progress to keep the feed moving.4. Configuration and DTOs
ServerConfig.kt(ProtoNumber 86).OpdsChapterListAcqEntryandOpdsChapterMetadataAcqEntry) to carry thedownloadedstatus andcbzFileSizeinfo.Configuring-Suwayomi-Server.mdabout 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.