Now that we can enjoy the conversion through calibre's ebook-convert, what do you think to let the user to convert the ebook to any type that tool can convert (almost any type out there).
I know most ereader can read epub format and kindles their format and with those many ereaders, but letting user to convert any-kind-to-any-kind will make calibre web as useful as calibre desktop.. we can even convert some PDFs epub (with the known limitations of the PDFs).
What do you think?
Working with @OzzieIsaacs was able to come with this feature: https://github.com/janeczku/calibre-web/pull/596
If a user has the ability to edit the metadata, and the system is configured for ebook-convert, the user should see a new option to convert books in the edit book page.
Give it a download and check it out. You can access my branch at: https://github.com/bodybybuddha/calibre-web/tree/ebookconvert-any
Thanks!
Can I change my docker container's branch to yours without any repercussions? Anxious to try it out !
@kianrafiee - depends on whose docker image you are using. I'm using @Technosoft2000's image and it works fine. You can revert back to the main branch at any time given you know about the "Known Issue" (see below).
Of course, this goes without saying, its always a good idea to test new changes out on a backup version of your install - or at least have a back up. (what could possibly go wrong?? ...right?..right?) Or just wait until some other brave souls takes the plunge.
If you look at the container environment variables, you'll see one for the GitHub repo and one for the branch. As I use docker-compose, I have the following in my yml file:
- APP_REPO=https://github.com/bodybybuddha/calibre-web.git
- APP_BRANCH=ebookconvert-any
The proper workflow to do this:
1) shut down your container.
2) As per the Known issues on @Technosoft2000's container - either rename the app directory and create a new app directory, or remove the contents of the existing app directory.
3) Modify either your docker command with the appropriate parameters for the app_repo and app_branch, or modify your docker-compose.yml file.
4) start your container.
The container will take slightly longer to load as it does have to pull from GitHub. Follow the steps above to change back to the official repo.
@bodybybuddha it works just perfect! I tried several conversions: PDF, DOCX... so far so good. :)
Just to mention its incompatibility with cali!Blur theme, and the fact that if a user cannot edit metadata, he or she cannot either convert the book, which is a bit disappointing.
I think the best approach would be your changes official by the upstream, and create a new permission "Convert to any format". So any normal users could convert file formats without having full access to the book data and metadata.
EDITED: and place the conversion tool more visible and accessible inside the book main details... perhaps a button besides the "Read in browser"'s button or so... I would think also to make bulk conversions as well... so, definitively, once the changes are accepted by the upstream a better place should be imagined
However, very good job!
@adocampo - thanks, but it was mostly @OzzieIsaacs code. I just duplicated it to be more generic.
I don't know if I would want just any user to request conversions. I think that if you trust someone to make metadata changes, they probably know enough about what they are doing and should be able to request a new format. -- MOST of my users wouldn't know an epub format versus mobi, much less the various other formats that ebook-convert supports. I wouldn't want them to make any changes to my system.
I would say that maybe another permission level would be more advantageous in the above situation if need be. Again, for my purposes granting the ability to someone with "higher"(?) level of access is fine. If a new permission is granted, I would agree that the position of the feature should be moved from the edit book page to the book details page. If we don't add the permission, keeping it where it is currently located makes sense to me.
How would you envision bulk conversions working? I can't think of an easy way of making that happening as we are currently asking the user to supply us with what source format to use and then what the target destination would be. Any bulk conversions would have to make some assumptions - for instance, take the first format found and then convert it to a specified format. Of course that specific format, in my mind, would be set for the collection of books converted.
Honestly, I think that implementing the above would be difficult and we already have a great tool that does that work - calibre!
It would be great if we had some way of voting & discussing these ideas outside of an issue ticket. Maybe a #slack channel or something?
Did you remove the branch? I no longer see it.
It鈥榮 merged into the main line of the code, so everybody can have benefit from it.
I also agree with @bodybybuddha that the edit role should be sufficient for converting formats
Oh nice! Didn't even realize!
@kianrafiee - sorry about that. I killed off my branch once the code was merged into the main line. Thanks @OzzieIsaacs for merging that in and refactoring the code some more!
Convert from metadata page is not working for me. Sorry I dont have logs right now. But I am on the most recent container.
Anyway, when I try to convert from PDF to MOBI/AZW3/AZW it brings up a IIS/Apache/etc generic error dialog page. No tasks are ever shown of it either. Ebook-convert shows up in the About page. Has anyone had success with converting? Is there something we have to modify on our end with the container variables/etc?
Error is tracked and fixed in #609.
Most helpful comment
@kianrafiee - depends on whose docker image you are using. I'm using @Technosoft2000's image and it works fine. You can revert back to the main branch at any time given you know about the "Known Issue" (see below).
Of course, this goes without saying, its always a good idea to test new changes out on a backup version of your install - or at least have a back up. (what could possibly go wrong?? ...right?..right?) Or just wait until some other brave souls takes the plunge.
If you look at the container environment variables, you'll see one for the GitHub repo and one for the branch. As I use docker-compose, I have the following in my yml file:
- APP_REPO=https://github.com/bodybybuddha/calibre-web.git
- APP_BRANCH=ebookconvert-any
The proper workflow to do this:
1) shut down your container.
2) As per the Known issues on @Technosoft2000's container - either rename the app directory and create a new app directory, or remove the contents of the existing app directory.
3) Modify either your docker command with the appropriate parameters for the app_repo and app_branch, or modify your docker-compose.yml file.
4) start your container.
The container will take slightly longer to load as it does have to pull from GitHub. Follow the steps above to change back to the official repo.