I want to automate to generate epub_library.opds file

5 posts / 0 new
Last post

I am working after long time on readium code.

So i am not getting, how can i generate the opds file OR update it, if any epub file are dropped in epub_content folder.

Is it auto generated from epub_library.json, if so then every time readium checking for JSON or OPDS?

No, it is essentially hand-coded.  However, the format is not complex and it is quite conceivable that you could put a watcher on the folder (OS dependent) and then generate a new entry in the OPDS when the EPUB arrives.  Of course, obtaining the thumbnails and metadata to populate the OPDS would require opening and querying the EPUB itself - not trivial but doable.

Correct, the OPDS (as well as the "legacy" JSON format) library files are typically manually created, or alternatively they can be automatically generated, ahead of time.

For example, the following NodeJS script:
https://github.com/readium/readium-cfi-js/blob/develop/readium-build-too...
...can be invoked as part of the readium-js-viewer build process:
https://github.com/readium/readium-js-viewer/blob/develop/package/packag...
...to create / update the following OPDS feeds directly from GitHub repositories containing "exploded" EPUB containers:
https://github.com/readium/readium-js-viewer/blob/develop/epub_content/e...
https://github.com/readium/readium-js-viewer/blob/develop/epub_content/e...
https://github.com/readium/readium-js-viewer/blob/develop/epub_content/e...
https://github.com/readium/readium-js-viewer/blob/develop/epub_content/e...
https://github.com/readium/readium-js-viewer/blob/develop/epub_content/e...

Conversely, the top-level OPDS was manually created:
https://github.com/readium/readium-js-viewer/blob/develop/epub_content/e...
(note how the above auto-gen'ed feeds are referenced from this central library definition, effectively nesting multiple OPDS feeds)

PS: the legacy JSON format ( https://github.com/readium/readium-js-viewer/blob/develop/epub_content/e... ) is effectively only used for the Chrome app nowadays, but the cloud reader remains backward-compatible with it.

I hope this helps.
Regards, Daniel

Correct, the OPDS (as well as the "legacy" JSON format) library files are typically manually created, or alternatively they can be automatically generated, ahead of time.

For example, the following NodeJS script:
https://github.com/readium/readium-cfi-js/blob/develop/readium-build-too...
...can be invoked as part of the readium-js-viewer build process:
https://github.com/readium/readium-js-viewer/blob/develop/package/packag...
...to create / update the following OPDS feeds directly from GitHub repositories containing "exploded" EPUB containers:
https://github.com/readium/readium-js-viewer/blob/develop/epub_content/e...
https://github.com/readium/readium-js-viewer/blob/develop/epub_content/e...
https://github.com/readium/readium-js-viewer/blob/develop/epub_content/e...
https://github.com/readium/readium-js-viewer/blob/develop/epub_content/e...
https://github.com/readium/readium-js-viewer/blob/develop/epub_content/e...

Conversely, the top-level OPDS was manually created:
https://github.com/readium/readium-js-viewer/blob/develop/epub_content/e...
(note how the above auto-gen'ed feeds are referenced from this central library definition, effectively nesting multiple OPDS feeds)

PS: the legacy JSON format ( https://github.com/readium/readium-js-viewer/blob/develop/epub_content/e... ) is effectively only used for the Chrome app nowadays, but the cloud reader remains backward-compatible with it.

I hope this helps.
Regards, Daniel

Thanks for your answer Ric and Daniel.

Now got where could i have to see for auto updated.

I'll twick in it with node-wathcer and genOPDS.js, once done ill be back. :)

Nice talking with you.

Secondary menu