Repository navigation
feat(mobile): send AZW3 and TXT files - #4
Merged
Merged
Conversation
Only an EPUB is converted. An AZW3's cover is read at add and uploaded first; one without a readable cover still goes.
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.
Only EPUB (converted) and PDF (sent as is) could be sent. Sharing an AZW3 showed "Kindle Drop sends EPUB and PDF files", and Kindle Drop didn't appear in the share sheet for
.txtfiles at all.How
Sender.addcopies the file in, reads its cover withKindleCore.deviceThumbnail, and stores the book asReady, the same way a PDF starts. It uploads the thumbnail and then the book, so the lock screen gets its cover. An AZW3 with no readable cover (no ASIN, or a personal document) is still sent, just without a thumbnail. The cover read only takes milliseconds, so it happens while adding, and an AZW3 never shows "Converting"..txtnatively as a personal document. Converting it would mean building an EPUB, then an AZW3, which is a lot of machinery for no benefit to the reader.isConvertible), so the timeline for AZW3, PDF and TXT starts at Uploaded, as it already did for PDF.application/vnd.amazon.mobi8-ebook,application/x-mobi8-ebook,text/plain), then the file extension. On the emulator, Android's MediaStore reports.azw3asapplication/octet-stream, so in practice the extension match is what catches AZW3. The share-sheet intent filters and the Choose a file picker accept the new types.AZW3,TXT) and the UI skill now list the four formats. Small files show their size in kB: a text file read "TXT · 0.0 MB" before this change.Native Change: the share sheet's
AndroidManifest.xmlgains intent filters, which changes the Android fingerprint.The
text/plainfilter also matches shared text that has no file, such as a link. Those shares get the unsupported-file message for now. Article URLs are a separate piece of work.Verification
formatOf,itemNameOf, and the sender: an AZW3 is sent with its cover first, an AZW3 without a cover is sent alone, and a TXT is sent as is. Also a test forfileSize.check:changedpasses.alchemy devWorker: I shared an AZW3 (made by calibre, EBOK with an ASIN) and a TXT from the Files app. Both reached Waiting for Kindle. The mailbox heldthumbnail_<asin>_EBOK_portrait.jpgthen….azw3, and thenField Notes.txt. Cancel sending emptied the mailbox. The dev app is paired with prod again.The "before" AZW3 shot runs main's JavaScript on the new client. Before this change, Kindle Drop didn't appear in the chooser for a
.txtat all.The screenshots live on the
assets/more-formatsbranch, so they stay out ofmain. That branch can be deleted after merge.#3 renames the app to Dropcap, so whichever of these lands second should update the "Kindle Drop sends …" line.