react-native-readium icon indicating copy to clipboard operation
react-native-readium copied to clipboard

[Feature Request] Support for accessing the metadata of a book

Open wizzbuzz opened this issue 1 year ago • 3 comments

I'm sorry if this already has been implemented, I couldn't find anything on it. I would like to upload a book to a local database, for which I need data like the author, description, title, and book cover. I know that in EPUB.js it's possible to access said data with a hook. I would like a similar feature implemented.

I would also be interested to implement it myself, but I am unsure where to start, being new to react native. Thanks!

wizzbuzz avatar Nov 22 '24 17:11 wizzbuzz

@wizzbuzz the readium specification contains such metadata: https://readium.org/architecture/streamer/parser/metadata.html#epub-3x-2

The way to do it would probably be to have a listener similar to onTableOfContents that would emit the metadata after the ebook has been parsed and is available.

Hopefully that makes sense.

jspizziri avatar Nov 25 '24 18:11 jspizziri

@wizzbuzz in my fork, I've added callbacks such as onPositions which gives me access to all the positions data in the publication. I could do something similar for the metadata and put up a PR to show this.

alecdhansen avatar Nov 25 '24 18:11 alecdhansen

@alecdhansen please feel free to submit PR's for any work you're doing on a fork. Enhancements are always welcome.

jspizziri avatar Nov 25 '24 18:11 jspizziri