calibre-web
calibre-web copied to clipboard
Embed metadata on convert
This is a draft PR that makes Calibre-Web embed metadata into files on conversion, just like Calibre does. Most of the code is refactoring how Calibre-Web deals with the Calibre binaries, which should also help with embedding metadata when sending or downloading books. For example, a directory containing all the supported Calibre binaries has to be chosen now, instead of the ebook-convert
binary directly.
There are a few obvious reasons why this is a draft for now. First, the refactoring and actual embedding might have to go into separate PRs. Also, the code quality could definitely be improved, and I will do so when some more fundamental things have been discussed.
Questions I have:
- Is the
get_calibre_binarypath()
function inconfig_sql.py
okay, or should class variables be used for all supported/needed Calibre binaries? - If we go with the
get_calibre_binarypath()
function, should_ConfigSQL.config_converterpath
be kept or shouldconfig.get_calibre_binarypath("ebook-convert")
be used everywhere? - If we go with class variables, should each path be specified manually by the user, or is automatically setting them from a directory sufficient?
- Is including the
_extension
variable inconstants.py
okay?
Would be happy to discuss if anyone wants to chime in.
So, I've cleaned up a little and decided to refactor get_calibre_binarypath()
out of the _ConfigSQL
class and into helper.py
. The _ConfigSQL.config_converterpath
DB column and variable still exists, but could be replaced by helper.get_calibre_binarypath("ebook-convert")
. I will mark this ready fore review.
@OzzieIsaacs Do you think you will be able to have a look at this in the near future? Thanks!
@OzzieIsaacs This would be a great change and would enable #2497 to have the metadata edited from Calibre Web actually be applied to the books when reading them on devices
It would be great! If it happen, i delete calibre standalone forever!
Any ETA that it merge?
Is this still in progress? Is it still required? I have got the ebook-convert binary in my docker container now (as the lsio mod) but still metadata is not being applied to the book and not present when it is downloaded onto an ereader. Is there anything I can help with, I know my way around python. Would be very nice to have to run calibre as well as calibre-web.
Just tried this out on the nightly image and it's working for me. Many thanks for your work :)
Also working! Great job, thanks!