Repository navigation
fix(server): make OPDS TXT acquisitions openable in Librera - #740
Merged
Merged
Conversation
Co-Authored-By: qin hector <hectorq.me@gmail.com>
Contributor
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
Contributor
|
Retested Before the fix, Librera saved the downloads with no extension and couldn't open them (recording of the Android shell test). |
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.
Summary
Fixes the TXT part of #735. Librera FD 10.0.35 (tested on an Android emulator) saved OPDS TXT downloads with no extension (e.g.
412010034.) and couldn't open them. Librera looks up the exact acquisitiontype, sotext/plain; charset=utf-8never matched TXT, and the/contenthref had no extension it could fall back on. The same downloaded bytes, renamed to.txt, open correctly.typeis now the bare MIME type (text/plain), and the href is/opds/books/:id/content/<file name>. The old/contentURL still works because:filename?is optional.charset=utf-8. The server streams the original bytes, which may be GBK. Decoded chapter text keeps its UTF-8 label.Content-Dispositionadds an ASCIIfilename="..."fallback beforefilename*=UTF-8''....Tests:
server/test/opds-server.test.tscovers the advertised URL and type, the headers, unchanged GBK bytes, and access control. Server typecheck, tests and format:check pass.Implemented in session Test issue 735 on Android emulator
Review with Devin · Open in Devin Desktop