misterunknown / ifm

Improved File Manager
MIT License
341 stars 70 forks source link

Support third-party EPUB reader #167

Closed maggie44 closed 3 years ago

maggie44 commented 3 years ago

This is something I have been trying to implement for my own use case. Adding here in case valuable to the larger project. When enabled in the config, clicking an EPUB file in IFM will take you to a third-party EPUB reader to display it rather than download the file (file can still be downloaded via the download button of course), making it more like how JPEGs and text documents work.

The third-party reader is open-source under an MIT License, so can also be pulled and run on someones own server, and can then redirect to that reader via the epub_path config variable.

Here are some other open source readers that can also be used: https://github.com/readium/readium-js-viewer#cloud-reader-deployment https://github.com/satorumurmur/bibi

Will document accordingly.

I forked the code from v4.0 and built from there as it seemed there were such significant changes, it would be easier to merge this way if you decide to include it.

Personally I feel this is going to benefit too few people to have it merged, but worse case scenario at least there will be an example here in the closed pull request for someone in the future.

Note, PHP/JS isn't my mother-tongue language so a thorough look will be necessary, and by all means feel free to edit directly.

maggie44 commented 3 years ago

I have been using it for a little while in my own environment, and the epub readers are a little temperamental. Subsequently, it would seem crazy to offer this and ask @misterunknown to support it through IFM, and I am unable to either. Going to close the request, I live and learn.