[Feature] Implement getMetadata() function for DjVu documents #753
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.
Overview
Pretty much what the title says. This implements the
getMetadata()
function for DjVu documents, following in the style of the same for the PDF implementation.This just dumbly copies all the metadata key-value pairs into a lua table. The intent is to give the frontend everything we possibly can and let it figure out what to do with the info, an example of which can be found in the companion pull request koreader/koreader#4314.
Notes
This is my first foray into koreader's code, not to mention anything lua-related. I tried to copy the surrounding style as much as I could, and I tested this out on my actual kindle. However, I'd not be surprised if I'm missing something obvious. Anyway, I hope this turns out to be helpful.